[FIX] Legacy libraries with shared linkage#1382
Merged
mborland merged 3 commits intoboostorg:developfrom Mar 18, 2026
Merged
Conversation
Signed-off-by: Philipp Remy <philipp@philippremy.net>
Signed-off-by: Philipp Remy <philipp@philippremy.net>
(1) Change MSVC to WIN32: The symbol export rules should also apply if a MinGW toolchain is used. (2) On targets other than MSVC, a build with BUILD_SHARED_LIBS=ON failed because the macro BOOST_SYMBOL_EXPORT was not properly defined. Define it to default visibility for proper symbol export in shared libraries. Signed-off-by: Philipp Remy <philipp@philippremy.net>
mborland
approved these changes
Mar 18, 2026
Member
mborland
left a comment
There was a problem hiding this comment.
These all seem like reasonable changes to me. Thanks for giving it a go and working out the bugs!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1382 +/- ##
========================================
Coverage 95.35% 95.35%
========================================
Files 825 825
Lines 68203 68203
========================================
+ Hits 65033 65034 +1
+ Misses 3170 3169 -1 see 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi!
Thank you again for adding the legacy modules to CMake. I noticed a small issue when trying it out: Compiling the legacy modules as shared libraries failed on my macOS machine, because the
BOOST_SYMBOL_EXPORTmacro was not defined properly. The fix is as simple as (just like with MSVC) explicitly setting the export visibility to"default". It seems that Boost and CMake default to hidden visibility, so in order for the shared library to expose the symbols correctly this must be adapted accordingly. I also changed theif(MSVC)toif(WIN32), which makes it compatible with MinGW based toolchains as well.I also added a CI workflow for the shared libraries (it just mirrors the one for the static linkage).
And theoretically it should also be possible to compile the legacy libraries in standalone mode, so I guarded any
Boost::configlogic behind the appropriate flag.If any of these changes (or all of them) are not wanted / not fitting the project, feel free to cherry-pick or close the PR altogether.