Skip to content

Conversation

JohannesKauffmann
Copy link
Collaborator

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant