From 8c9eab85c792522bf6c07802480bef7196e8a8c0 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sun, 29 Dec 2024 16:55:09 +0100 Subject: [PATCH] Fixup: Re-add `-fPIC` Fixup of c00fdb161004e06e52ef46ba921014bd15b1601b The mentioned commit removes the `-fPIC` flag, but this is needed in Zyn: Even though zyn links rtosc as a `.a` file, the plugin versions are shared objects and do require that every part, including rtosc is compiled with `-fPIC`. On the other side it is desired to compile rtosc as a `.a` into zyn to be able to use link time optimization (LTO) and for distributional reasons. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f85623..40a5464 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,8 @@ target_compile_features(rtosc-cpp PUBLIC cxx_std_11) target_include_directories(rtosc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_compile_options(rtosc PRIVATE "$<$>:-std=c99>") +set_target_properties(rtosc PROPERTIES POSITION_INDEPENDENT_CODE ON) +set_target_properties(rtosc-cpp PROPERTIES POSITION_INDEPENDENT_CODE ON) if(RTOSC_IWYU_PATH AND RTOSC_INCLUDE_WHAT_YOU_USE) set(RTOSC_IWYU_PATH_AND_OPTIONS