Merge pull request #464 from mwoehlke-kitware/elf-visibility

ELF visibility
This commit is contained in:
Lee Thomason 2016-08-11 07:32:50 -07:00 committed by GitHub
commit cb6461ca9c
2 changed files with 5 additions and 0 deletions

View File

@ -64,6 +64,9 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
option(BUILD_SHARED_LIBS "build as shared library" ON)
option(BUILD_STATIC_LIBS "build as static library" OFF)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
if(BUILD_SHARED_LIBS)
add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)

View File

@ -72,6 +72,8 @@ distribution.
# else
# define TINYXML2_LIB
# endif
#elif __GNUC__ >= 4
# define TINYXML2_LIB __attribute__((visibility("default")))
#else
# define TINYXML2_LIB
#endif