Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,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" OR
Expand Down
4 changes: 4 additions & 0 deletions include/yaml-cpp/dll.h
Original file line number Diff line number Diff line change
Expand Up @@ -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