Build both static and shared version of libgerbv at the same time#425
Merged
spe-ciellt merged 1 commit intodevelopfrom Mar 10, 2026
Merged
Conversation
By creating a default library as an INTERFACE target and then make two different (STATIC and SHARED) targets that links to the INTERFACE target we can get both libraries at the same time. By using an INTERFACE target we don't have to set target_sources() and other things twice, we simply reuse the INTERFACE target for both. INTERFACE targets doesn't compile, it just carries the information over. The respective SHARED and STATIC target does the compilation with the information from the INTERFACE target. The only caveat so far seems to be that the dxflib_bundles (which is an OBJECT library) needs to be set as a linked library in both STATIC and SHARED. It is not "carried over" from the INTERFACE library.
4 tasks
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.
By creating a default library as an
INTERFACEtarget and then make two different (STATIC and SHARED) targets that links to theINTERFACEtarget we can get both libraries at the same time.By using an
INTERFACEtarget we don't have to settarget_sources()and other things twice, we simply reuse theINTERFACEtarget for both.INTERFACEtargets doesn't compile, it just carries the information over. The respectiveSHAREDandSTATICtarget does the compilation with the information from theINTERFACEtarget.The only caveat so far seems to be that the
dxflib_bundled(which is anOBJECTlibrary) needs to be set as a linked library in bothSTATICandSHARED. It is not "carried over" from theINTERFACElibrary.Improved over #417
Checked that both
.deband.rpmcontains bothlibgerbv.aandlibgerbv.so*, and the application is linked against the shared library.Closes #416