From 266de500198b7abf752e157bec81367a7c075f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Thu, 25 Jun 2020 00:26:12 +0200 Subject: [PATCH 1/2] CMake: Declare platform libraries to be explicitly static. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- cmake/Helper.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Helper.cmake b/cmake/Helper.cmake index fc8890349..66b65e54d 100644 --- a/cmake/Helper.cmake +++ b/cmake/Helper.cmake @@ -217,7 +217,7 @@ FUNCTION(ADD_PLATFORM_LIBRARY _name) ENDIF() ENDFOREACH() - ADD_LIBRARY(${_name} ${FILES}) + ADD_LIBRARY(${_name} STATIC ${FILES}) TARGET_INCLUDE_DIRECTORIES(${_name} INTERFACE "$") IF(IOS) SET_TARGET_PROPERTIES(${_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) From 500fe6620914731fe191bce24148b3d2286e4b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Thu, 25 Jun 2020 00:45:42 +0200 Subject: [PATCH 2/2] CMake: Declare the external HttpParser library to be static. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/external/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/external/CMakeLists.txt b/src/external/CMakeLists.txt index 361090ff7..10576d93b 100644 --- a/src/external/CMakeLists.txt +++ b/src/external/CMakeLists.txt @@ -48,7 +48,7 @@ IF(HTTP_PARSER_FOUND) ELSE() SET(HTTP_PARSER_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/http_parser") FILE(GLOB_RECURSE EXTERNAL_HTTP_PARSER_FILES ${HTTP_PARSER_INCLUDE_DIR}/*.cpp) - ADD_LIBRARY(AusweisAppExternalHttpParser ${EXTERNAL_HTTP_PARSER_FILES}) + ADD_LIBRARY(AusweisAppExternalHttpParser STATIC ${EXTERNAL_HTTP_PARSER_FILES}) TARGET_INCLUDE_DIRECTORIES(AusweisAppExternalHttpParser INTERFACE "$") IF(IOS)