mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #464 from mwoehlke-kitware/elf-visibility
ELF visibility
This commit is contained in:
commit
cb6461ca9c
|
@ -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_SHARED_LIBS "build as shared library" ON)
|
||||||
option(BUILD_STATIC_LIBS "build as static library" OFF)
|
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)
|
if(BUILD_SHARED_LIBS)
|
||||||
add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)
|
add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,8 @@ distribution.
|
||||||
# else
|
# else
|
||||||
# define TINYXML2_LIB
|
# define TINYXML2_LIB
|
||||||
# endif
|
# endif
|
||||||
|
#elif __GNUC__ >= 4
|
||||||
|
# define TINYXML2_LIB __attribute__((visibility("default")))
|
||||||
#else
|
#else
|
||||||
# define TINYXML2_LIB
|
# define TINYXML2_LIB
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue