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()