From bc49543109f75c6d166fbd8402892011cb8414ac Mon Sep 17 00:00:00 2001 From: Marco Randazzo Date: Tue, 5 Sep 2023 15:34:00 +0200 Subject: [PATCH] added CMAKE_POSITION_INDEPENDENT_CODE -fPIC --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f20893d..f18c286 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,10 @@ set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP "Generated Files") # See cmake/YarpOptions.cmake. #include(YarpOptions) +######################################################################### +# Compile libraries using -fPIC to produce position independent code. +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + ######################################################################### # Control whether libraries are shared or static (imported from YarpOptions)