From 9d17b0a9b93e684a5ac6cac8f70d9a7909a877cf Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Wed, 23 Sep 2015 00:38:31 +0200 Subject: Fix CMake CMP0063 warning when building static --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fc6bf1122..cda1297027 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,9 +45,12 @@ if(NBT_USE_ZLIB) endif() target_compile_options(nbt++ PUBLIC -std=c++11) generate_export_header(nbt++ BASE_NAME nbt) -set_target_properties(nbt++ PROPERTIES - CXX_VISIBILITY_PRESET hidden - VISIBILITY_INLINES_HIDDEN 1) + +if(${BUILD_SHARED_LIBS}) + set_target_properties(nbt++ PROPERTIES + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN 1) +endif() if(NBT_BUILD_TESTS) enable_testing() -- cgit 0.0.5-2-1-g0f52