From f0bac8852a45cf0b863c63b3756777db5b5b47f6 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Tue, 15 Jun 2021 23:55:34 +0200 Subject: [PATCH] cmake: allow to override `-fPIC` --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e97d5f7..4b9503d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,9 @@ endif (NOT WITH_THREADS) set (CMAKE_C_VISIBILITY_PRESET hidden) set (CMAKE_CXX_VISIBILITY_PRESET hidden) -set (CMAKE_VISIBILITY_INLINES_HIDDEN 1) +set (CMAKE_POSITION_INDEPENDENT_CODE ON) +set (CMAKE_VISIBILITY_INLINES_HIDDEN ON) + list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) include (CheckCXXCompilerFlag) @@ -585,8 +587,6 @@ add_library (glog add_library (glog::glog ALIAS glog) -set_target_properties (glog PROPERTIES POSITION_INDEPENDENT_CODE ON) - if (Unwind_FOUND) target_link_libraries (glog PUBLIC unwind::unwind) set (Unwind_DEPENDENCY "find_dependency (Unwind ${Unwind_VERSION})")