-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tinyxml2]: do not force export the symbols when building statically #27514
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to merge such headers. (Minimal diff.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These patches were autogenerated from the git commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't ask for reasons.
Just use
git diff
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the Git Patch VsCode extension. Not my first time making PRs with such patches here. If you have a particular patch style, consider enforcing it through CI or a friendly review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish there had been time for community review.
In 9 of 10 cases, reviewer would ask you to minimize the patches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to poke other maintainers about this, that I tend to like these headers because it makes it easier figure out of upstream has merged them or not is showing. Will add the result to the maintainer guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @BillyONeal. As another example, see the two recent zlib patches.
I do prefer headers if they help to identify the patches as in the zlib cases.
OTOH the headers here do not add useful information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ras0219-msft @JavierMatosD @markle11m @vicroms @AugP @valeriaconde @dan-shaw, and I discussed this today.
@BillyONeal proposes:
@ras0219-msft proposes:
PATCHES
list) that points out how it was submitted and that is used instead.@markle11m explicitly likes Robert's suggestion.
@vicroms notes that he is not opposed to comments in the patch files.
@BillyONeal to author a change adopting @ras0219-msft's suggestion to the maintainer guide.