This commit is contained in:
Christopher James Halse Rogers 2019-09-26 06:40:38 +00:00 committed by GitHub
commit 26c4f92400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -136,6 +136,14 @@ if(WIN32)
endif()
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
if (POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
add_definitions(-DYAML_CPP_USE_VISIBILITY)
endif()
# GCC or Clang or Intel Compiler specialities
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") OR

View File

@ -27,7 +27,11 @@
#define YAML_CPP_API __declspec(dllimport)
#endif // yaml_cpp_EXPORTS
#else // YAML_CPP_DLL
#ifdef YAML_CPP_USE_VISIBILITY
#define YAML_CPP_API __attribute__ ((visibility("default")))
#else
#define YAML_CPP_API
#endif // YAML_CPP_USE_VISIBILITY
#endif // YAML_CPP_DLL
#endif // DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66