Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Declare platform libraries to be explicitly static. #26

Conversation

besser82
Copy link
Contributor

The libraries declared in CMake using the custom ADD_PLATFORM_LIBRARY function are intended for internal consumption by AusweisApp2. These libraries do NOT have a proper so-name, neither get properly installed by CMake, nor header files for integration into external applications are provided.

In most of the rpm-based Linux distributions the macroized invocation of CMake assumes any non-explicitly as STATIC or OBJECT declared library to be implicitly built as SHARED.

Thus libraries that are intended to be a 'platform' library for the AusweisApp2 application need to be explicitly declared as STATIC.

The libraries declared in CMake using the custom `ADD_PLATFORM_LIBRARY`
function are intended for internal consumption by AusweisApp2.  These
libraries do NOT have a proper so-name, neither get properly installed
by CMake, nor header files for integration into external applications
are provided.

In most of the rpm-based Linux distributions the macroized invocation
of CMake assumes any non-explicitly as STATIC or OBJECT declared
library to be implicitly built as SHARED.

Thus libraries that are intended to be a 'platform' library for the
AusweisApp2 application need to be explicitly declared as STATIC.

Signed-off-by: Björn Esser <[email protected]>
@CLAassistant
Copy link

CLAassistant commented Jun 24, 2020

CLA assistant check
All committers have signed the CLA.

The ExternalHttpParser library is built in case the underlying system
does not offer a usable HttpParser library.

In the previous commit we changed the 'platform' libraries to be
explicitly built as STATIC.  The reasoning given there applies to this
library as well.

Signed-off-by: Björn Esser <[email protected]>
@misery
Copy link
Contributor

misery commented Jun 25, 2020

Thanks for your request!

It seems a lot of Linux distributions uses BUILD_SHARED_LIBS=ON today. This is NOT the default of cmake.
We use this to optimize internal build machines for unit- and integrationtests. So we use BUILD_SHARED_LIBS dynamically.

Just pass "-DBUILD_SHARED_LIBS=OFF" to your build step.
We will look into it to use another approach later.

(Similar to #24)

@misery misery closed this Jun 26, 2020
@besser82 besser82 deleted the topic/besser82/cmake_internal_libs branch June 26, 2020 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants