From d852badd5161ee8d53087112ac3afc36a3596dd8 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Mon, 11 Sep 2023 17:12:23 +0200 Subject: [PATCH] Fix -fPIC --- Bar/CMakeLists.txt | 1 + Foo/CMakeLists.txt | 1 + FooBar/CMakeLists.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/Bar/CMakeLists.txt b/Bar/CMakeLists.txt index e786b44..ceed52d 100644 --- a/Bar/CMakeLists.txt +++ b/Bar/CMakeLists.txt @@ -11,6 +11,7 @@ target_include_directories(Bar target_compile_features(Bar PUBLIC cxx_std_17) set_target_properties(Bar PROPERTIES VERSION ${PROJECT_VERSION} + POSITION_INDEPENDENT_CODE ON PUBLIC_HEADER include/bar/Bar.hpp) #target_link_libraries(Bar PUBLIC ...) add_library(${PROJECT_NAMESPACE}::Bar ALIAS Bar) diff --git a/Foo/CMakeLists.txt b/Foo/CMakeLists.txt index ca3f45a..9795008 100644 --- a/Foo/CMakeLists.txt +++ b/Foo/CMakeLists.txt @@ -10,6 +10,7 @@ target_include_directories(Foo target_compile_features(Foo PUBLIC cxx_std_17) set_target_properties(Foo PROPERTIES VERSION ${PROJECT_VERSION} + POSITION_INDEPENDENT_CODE ON PUBLIC_HEADER include/foo/Foo.hpp) #target_link_libraries(Foo PUBLIC ...) add_library(${PROJECT_NAMESPACE}::Foo ALIAS Foo) diff --git a/FooBar/CMakeLists.txt b/FooBar/CMakeLists.txt index 781c6b4..686e014 100644 --- a/FooBar/CMakeLists.txt +++ b/FooBar/CMakeLists.txt @@ -18,6 +18,7 @@ if(APPLE) INSTALL_RPATH "@loader_path") elseif(UNIX) set_target_properties(FooBar PROPERTIES + POSITION_INDEPENDENT_CODE ON INSTALL_RPATH "$ORIGIN") endif() target_link_libraries(FooBar