From 23098c9fe00399b4b977f2d039f1073b17b93a71 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Sun, 19 Mar 2017 21:45:13 +0000 Subject: [PATCH] Use a compiler-independent way to say -fPIC --- src/common/CMakeLists.txt | 5 ++++- src/pq/CMakeLists.txt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index aaa2809..8926d33 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -36,5 +36,8 @@ target_link_libraries(${PROJECT_NAME} #see https://cmake.org/pipermail/cmake/2007-May/014350.html #and http://stackoverflow.com/questions/6093547/what-do-r-x86-64-32s-and-r-x86-64-64-relocation-mean/6093910#6093910 if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC") + #see https://github.com/CarloWood/cmaketest/blob/master/bar.cmake + set_target_properties(${PROJECT_NAME} PROPERTIES + POSITION_INDEPENDENT_CODE ON #Compile this object code position independent. + ) endif() diff --git a/src/pq/CMakeLists.txt b/src/pq/CMakeLists.txt index 6dbf43e..9108226 100644 --- a/src/pq/CMakeLists.txt +++ b/src/pq/CMakeLists.txt @@ -32,5 +32,8 @@ target_compile_features(${PROJECT_NAME} #see https://cmake.org/pipermail/cmake/2007-May/014350.html #and http://stackoverflow.com/questions/6093547/what-do-r-x86-64-32s-and-r-x86-64-64-relocation-mean/6093910#6093910 if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC") + #see https://github.com/CarloWood/cmaketest/blob/master/bar.cmake + set_target_properties(${PROJECT_NAME} PROPERTIES + POSITION_INDEPENDENT_CODE ON #Compile this object code position independent. + ) endif()