From 0fd8073f2945ba928c4c7bd401b38cc6eaa9d23d Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Mon, 31 Oct 2022 15:40:09 -0400 Subject: [PATCH] {test} Fix warning about symbol visibility (#156) Fixes #123 --- CMakeLists.txt | 14 +++++++++++--- test/CMakeLists.txt | 4 ---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6de2c21..5e1b3ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ) @@ -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() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 80b2f7c..36b988b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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