Merge pull request #820 from orudge/fix-symbol-export

cmake: Don't export symbols if building static library
This commit is contained in:
Lee Thomason
2020-09-17 13:19:14 -07:00
committed by GitHub

View File

@@ -30,9 +30,7 @@ set(GENERIC_LIB_SOVERSION "8")
################################ ################################
# Add targets # Add targets
# By Default shared library is being built # By Default shared library is being built
# To build static libs also - Do cmake . -DBUILD_STATIC_LIBS:BOOL=ON # User can choose to build static library by using cmake -DBUILD_SHARED_LIBS:BOOL=OFF
# User can choose not to build shared library by using cmake -DBUILD_SHARED_LIBS:BOOL=OFF
# To build only static libs use cmake . -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_STATIC_LIBS:BOOL=ON
# To build the tests, use cmake . -DBUILD_TESTS:BOOL=ON # To build the tests, use cmake . -DBUILD_TESTS:BOOL=ON
# To disable the building of the tests, use cmake . -DBUILD_TESTS:BOOL=OFF # To disable the building of the tests, use cmake . -DBUILD_TESTS:BOOL=OFF
@@ -51,7 +49,7 @@ set(CMAKE_DEBUG_POSTFIX "d")
add_library(tinyxml2 tinyxml2.cpp tinyxml2.h) add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)
set_target_properties(tinyxml2 PROPERTIES set_target_properties(tinyxml2 PROPERTIES
COMPILE_DEFINITIONS "TINYXML2_EXPORT" DEFINE_SYMBOL "TINYXML2_EXPORT"
VERSION "${GENERIC_LIB_VERSION}" VERSION "${GENERIC_LIB_VERSION}"
SOVERSION "${GENERIC_LIB_SOVERSION}") SOVERSION "${GENERIC_LIB_SOVERSION}")