From 9a8acdf6ebe47b91c57c88bad878c0ecee83e659 Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Wed, 19 Sep 2018 18:31:21 +0200 Subject: [PATCH] Enable PIC by default --- cmake/FairLoggerLib.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/FairLoggerLib.cmake b/cmake/FairLoggerLib.cmake index 0297998..d48d676 100644 --- a/cmake/FairLoggerLib.cmake +++ b/cmake/FairLoggerLib.cmake @@ -129,6 +129,11 @@ macro(set_fairlogger_defaults) set(BUILD_SHARED_LIBS ON CACHE BOOL "Whether to build shared libraries or static archives") endif() + # Set -fPIC as default for all library types + if(NOT CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + # Define CMAKE_INSTALL_*DIR family of variables include(GNUInstallDirs)