diff options
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | cmake/opentrack-platform.cmake | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3277fd4d..dc96a504 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,12 @@ # OTHER DEALINGS IN THE SOFTWARE. set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) + +set(CMAKE_C_LINKER_PREFERENCE CXX) +set(CMAKE_CXX_LINKER_PREFERENCE CXX) +set(CMAKE_C_LINKER_PREFERENCE_PROPAGATES ON) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES ON) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") include(opentrack-mrproper) diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake index 1141eac8..332fd51f 100644 --- a/cmake/opentrack-platform.cmake +++ b/cmake/opentrack-platform.cmake @@ -155,6 +155,13 @@ if(MINGW) add_definitions(-DMINGW_HAS_SECURE_API) endif() +# assume binutils +if(LINUX) + foreach (i SHARED MODULE EXE) + set(CMAKE_${i}_LINKER_FLAGS "${CMAKE_${i}_LINKER_FLAGS} -Wl,-z,relro,-z,now,--exclude-libs,ALL") + endforeach() +endif() + if(UNIX AND NOT APPLE) include(opentrack-pkg-config) endif() |