From cb08473bdc24b7717fadc0c2bafb73024912ef9c Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 14 Sep 2025 17:28:34 +0100 Subject: [PATCH] cmake: remove explicit fPIC handling With CMP0083 introduced with cmake 3.14, as we set the variable CMAKE_POSITION_INDEPENDENT_CODE we can rely on the build system to do the correct thing, across all the targets. Since we require 3.18 (or 3.16 in the patched Debian/Ubuntu version), which sets the policy to NEW we're all set. Signed-off-by: Emil Velikov --- src/plugins/CMakeLists.txt | 3 --- tests/fuzz/CMakeLists.txt | 4 ---- tests/unit/CMakeLists.txt | 4 ---- 3 files changed, 11 deletions(-) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 252d026e2..4ae3323bb 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -39,9 +39,6 @@ add_library(weechat_plugins STATIC ${LIB_PLUGINS_SRC}) target_link_libraries(weechat_plugins coverage_config) add_definitions(${CMAKE_SHARED_LIBRARY_C_FLAGS}) -if(NOT CYGWIN) - add_definitions(-fPIC) -endif() add_library(weechat_plugins_scripts STATIC ${LIB_PLUGINS_SCRIPTS_SRC}) include(CheckIncludeFiles) diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt index a6f591ee3..c211e3b5d 100644 --- a/tests/fuzz/CMakeLists.txt +++ b/tests/fuzz/CMakeLists.txt @@ -36,10 +36,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) -if(NOT CYGWIN) - add_definitions(-fPIC) -endif() - list(APPEND FUZZ_TARGET_LINK weechat_core weechat_plugins diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index f06b3006d..2df393210 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -29,10 +29,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) -if(NOT CYGWIN) - add_definitions(-fPIC) -endif() - if(ENABLE_PYTHON) add_definitions(-DHAVE_PYTHON) endif()