mirror of https://github.com/AxioDL/tinyxml2.git
Build with hidden symbols by default
Turn on options to tell CMake to use -fvisibility=hidden by default (on applicable platforms). This has some optimization benefits, and more closely mirrors the Windows behavior of only exporting symbols marked for export, which can help catch errors doing so on non-Windows platforms. This requires CMake 2.8.12 to be effective. (Otherwise, the logic will simply have no effect.)
This commit is contained in:
parent
a8e7ea7fb0
commit
8170bdc693
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue