-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tinyxml2]: do not force export the symbols when building statically
- Loading branch information
Showing
5 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
ports/tinyxml2/0001-fix-do-not-force-export-the-symbols-when-building-st.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
From a512d312db5604efe803a6fe088e7d582e04533f Mon Sep 17 00:00:00 2001 | ||
From: Amin Yahyaabadi <aminyahyaabadi74@gmail.com> | ||
Date: Wed, 26 Oct 2022 18:21:29 -0700 | ||
Subject: [PATCH] fix: do not force export the symbols when building statically | ||
|
||
--- | ||
CMakeLists.txt | 11 ++++++++--- | ||
1 file changed, 8 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 8802fb8..87cda90 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -16,8 +16,10 @@ endif () | ||
## Main library build | ||
## | ||
|
||
-set(CMAKE_CXX_VISIBILITY_PRESET hidden) | ||
-set(CMAKE_VISIBILITY_INLINES_HIDDEN YES) | ||
+if (BUILD_SHARED_LIBS) | ||
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden) | ||
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN YES) | ||
+endif() | ||
|
||
add_library(tinyxml2 tinyxml2.cpp tinyxml2.h) | ||
add_library(tinyxml2::tinyxml2 ALIAS tinyxml2) | ||
@@ -36,11 +38,14 @@ target_compile_definitions( | ||
set_target_properties( | ||
tinyxml2 | ||
PROPERTIES | ||
- DEFINE_SYMBOL "TINYXML2_EXPORT" | ||
VERSION "${tinyxml2_VERSION}" | ||
SOVERSION "${tinyxml2_VERSION_MAJOR}" | ||
) | ||
|
||
+if(BUILD_SHARED_LIBS) | ||
+ target_compile_definitions(tinyxml2 PRIVATE "TINYXML2_EXPORT") | ||
+endif() | ||
+ | ||
if (tinyxml2_BUILD_TESTING) | ||
add_executable(xmltest xmltest.cpp) | ||
target_link_libraries(xmltest PRIVATE tinyxml2::tinyxml2) | ||
-- | ||
2.37.3.windows.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters