]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | From f8b048656b9937252ce5fb4ebea9e5df5b203bdb Mon Sep 17 00:00:00 2001 |
2 | From: Owen Rudge <owen@owenrudge.net> | |
3 | Date: Wed, 27 May 2020 09:40:59 +0100 | |
4 | Subject: [PATCH] cmake: Don't export symbols if building static library | |
5 | ||
6 | --- | |
7 | CMakeLists.txt | 12 +++++++++--- | |
8 | 1 file changed, 9 insertions(+), 3 deletions(-) | |
9 | ||
10 | diff --git a/CMakeLists.txt b/CMakeLists.txt | |
11 | index 9f9ab07..67b4f33 100644 | |
12 | --- a/CMakeLists.txt | |
13 | +++ b/CMakeLists.txt | |
14 | @@ -50,10 +50,16 @@ set(CMAKE_DEBUG_POSTFIX "d") | |
15 | \r | |
16 | add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)\r | |
17 | \r | |
18 | -set_target_properties(tinyxml2 PROPERTIES\r | |
19 | +if(BUILD_SHARED_LIBS)\r | |
20 | + set_target_properties(tinyxml2 PROPERTIES\r | |
21 | COMPILE_DEFINITIONS "TINYXML2_EXPORT"\r | |
22 | - VERSION "${GENERIC_LIB_VERSION}"\r | |
23 | - SOVERSION "${GENERIC_LIB_SOVERSION}")\r | |
24 | + VERSION "${GENERIC_LIB_VERSION}"\r | |
25 | + SOVERSION "${GENERIC_LIB_SOVERSION}")\r | |
26 | +else()\r | |
27 | + set_target_properties(tinyxml2 PROPERTIES\r | |
28 | + VERSION "${GENERIC_LIB_VERSION}"\r | |
29 | + SOVERSION "${GENERIC_LIB_SOVERSION}")\r | |
30 | +endif()\r | |
31 | \r | |
32 | target_compile_definitions(tinyxml2 PUBLIC $<$<CONFIG:Debug>:TINYXML2_DEBUG>)\r | |
33 | \r | |
34 | -- | |
35 | 2.25.1.windows.1 | |
36 |