Avoid building both a shared and static library #85
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 is no reason to unconditionally build both variants. It increases
compile times, and consumers already know whether or not they want a
static or shared artifact. Instead, use a standard CMake construct to
build either one of them.
To allow users to override static vs shared for EIPScanner only, use a
new variable called EIPScanner_SHARED_LIBS: If set, our add_library()
will create a shared library, if not, a static library is created.
Building a static library by default also matches the default behaviour
of add_library().
This still allows users to specify BUILD_SHARED_LIBS on the command line
as an ultimate override, but at the same time avoids having
BUILD_SHARED_LIBS be the only option for building static vs shared.