From 32fed5af7315c43174b02a71f8521439139f62b8 Mon Sep 17 00:00:00 2001 From: immibis Date: Wed, 11 Oct 2023 05:15:57 +0200 Subject: [PATCH] Fix build - static library used in shared library must have position-independent code --- colobot-common/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/colobot-common/CMakeLists.txt b/colobot-common/CMakeLists.txt index 84dd8a5f..96d98b95 100644 --- a/colobot-common/CMakeLists.txt +++ b/colobot-common/CMakeLists.txt @@ -1,5 +1,10 @@ add_library(Colobot-Common STATIC) +if(NOT CBOT_STATIC) +# required to use static library inside CBot shared library + set_property(TARGET Colobot-Common PROPERTY POSITION_INDEPENDENT_CODE ON) +endif() + target_sources(Colobot-Common PRIVATE src/common/stringutils.cpp src/common/stringutils.h