-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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 (#…
…27514) * [tinyxml2]: do not force export the symbols when building statically leethomason/tinyxml2#922 * [tinyxml2]: check for TINYXML2_EXPORT on non windows * [tinyxml2] avoid redefinition of TINYXML2_LIB
- Loading branch information
Showing
6 changed files
with
80 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 | ||
|
25 changes: 25 additions & 0 deletions
25
ports/tinyxml2/0002-fix-check-for-TINYXML2_EXPORT-on-non-windows.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,25 @@ | ||
From 4beabf9fe05a049577e3923327804851d6a05f24 Mon Sep 17 00:00:00 2001 | ||
From: Amin Yahyaabadi <aminyahyaabadi74@gmail.com> | ||
Date: Thu, 27 Oct 2022 19:06:52 -0700 | ||
Subject: [PATCH] fix: check for TINYXML2_EXPORT on non windows | ||
|
||
--- | ||
tinyxml2.h | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/tinyxml2.h b/tinyxml2.h | ||
index cfb1053..5a36901 100755 | ||
--- a/tinyxml2.h | ||
+++ b/tinyxml2.h | ||
@@ -72,7 +72,7 @@ distribution. | ||
# else | ||
# define TINYXML2_LIB | ||
# endif | ||
-#elif __GNUC__ >= 4 | ||
+#elif defined(TINYXML2_EXPORT) && __GNUC__ >= 4 | ||
# define TINYXML2_LIB __attribute__((visibility("default"))) | ||
#else | ||
# define TINYXML2_LIB | ||
-- | ||
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