Allow static library builds via BUILD_SHARED_LIBS#314
Merged
spe-ciellt merged 1 commit intogerbv:developfrom Mar 3, 2026
Merged
Allow static library builds via BUILD_SHARED_LIBS#314spe-ciellt merged 1 commit intogerbv:developfrom
spe-ciellt merged 1 commit intogerbv:developfrom
Conversation
Remove the explicit SHARED keyword from add_library(gerbv) so that CMake's BUILD_SHARED_LIBS variable controls the library type. Default behavior is unchanged (shared), but users can now pass -DBUILD_SHARED_LIBS=OFF to build libgerbv as a static library. Closes gerbv#272
This was referenced Mar 3, 2026
Contributor
|
Great thing, simple enough. Merging. |
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.
Summary
SHAREDkeyword fromadd_library(gerbv)insrc/CMakeLists.txtBUILD_SHARED_LIBSvariable now controls the library type-DBUILD_SHARED_LIBS=OFFfor static buildsDetails
This is the standard CMake idiom for letting users choose between shared and static libraries. The name-clash concern raised in #272 is already solved — the app target is
gerbv-app(withOUTPUT_NAME gerbv), and the library target isgerbv, so there's no conflict regardless of library type.Usage
Test plan
libgerbv.so)-DBUILD_SHARED_LIBS=OFFproduces static library (libgerbv.a)Closes #272