From b685f235eb70941ef30fdae74d8c1ef8a4dfac2e Mon Sep 17 00:00:00 2001 From: Joseph Birkner Date: Wed, 19 Jun 2024 16:39:48 +0200 Subject: [PATCH] Do not CMAKE_POSITION_INDEPENDENT_CODE. It is verboten by conan-center-index to set CMAKE_POSITION_INDEPENDENT_CODE. --- CMakeLists.txt | 1 - deps.cmake | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4fdf54..ad901a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,6 @@ endif() if (SIMFIL_SHARED) set(LIBRARY_TYPE SHARED) - set(CMAKE_POSITION_INDEPENDENT_CODE YES) else() set(LIBRARY_TYPE STATIC) endif() diff --git a/deps.cmake b/deps.cmake index d78bcda..3c33ee8 100644 --- a/deps.cmake +++ b/deps.cmake @@ -8,6 +8,10 @@ if (SIMFIL_CONAN) find_package(nlohmann_json REQUIRED) endif() else() + if (SIMFIL_SHARED) + set (CMAKE_POSITION_INDEPENDENT_CODE ON) + endif () + if (NOT TARGET sfl::sfl) FetchContent_Declare(sfl GIT_REPOSITORY "https://github.com/slavenf/sfl-library.git"