Skip to content

Commit

Permalink
{test} Fix warning about symbol visibility (#156)
Browse files Browse the repository at this point in the history
Fixes #123
  • Loading branch information
asmaloney authored Oct 31, 2022
1 parent d196939 commit 0fd8073
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ if ( E57_WRITE_CRAZY_PACKET_MODE )
endif()

if ( E57_VISIBILITY_HIDDEN )
set_target_properties( E57Format PROPERTIES CXX_VISIBILITY_PRESET hidden )
set_target_properties( E57Format
PROPERTIES
CXX_VISIBILITY_PRESET hidden
CMAKE_VISIBILITY_INLINES_HIDDEN ON
)
endif()

if ( WIN32 )
Expand Down Expand Up @@ -203,8 +207,12 @@ option( E57_BUILD_TEST
)

if ( E57_BUILD_TEST )
# If we are building tests, we need access to all the symbols, so override CXX_VISIBILITY_PRESET
set_target_properties( E57Format PROPERTIES CXX_VISIBILITY_PRESET default )
# If we are building tests, we need access to all the symbols, so override visibility
set_target_properties( E57Format
PROPERTIES
CXX_VISIBILITY_PRESET default
CMAKE_VISIBILITY_INLINES_HIDDEN OFF
)

enable_testing()

Expand Down
4 changes: 0 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ set_target_properties( testE57
POSITION_INDEPENDENT_CODE ON
)

if ( E57_VISIBILITY_HIDDEN )
set_target_properties( testE57 PROPERTIES CXX_VISIBILITY_PRESET hidden)
endif()

target_compile_options( testE57
PUBLIC
# add switches to MSVC for UTF-8 handling in our test files
Expand Down

0 comments on commit 0fd8073

Please sign in to comment.