diff options
| author | xiphon <xiphon@protonmail.com> | 2020-08-28 17:54:17 +0000 |
|---|---|---|
| committer | xiphon <xiphon@protonmail.com> | 2020-08-28 17:54:17 +0000 |
| commit | 86f5aae63dd4e7e9beee5b3cea5bb3dc3265d8e2 (patch) | |
| tree | f5e082244e84613db6eacc1c218f6afd86bb4147 /CMakeLists.txt | |
| parent | e65159163d91a4d5f5f0159c989108880e652670 (diff) | |
| download | monzero-gui-86f5aae63dd4e7e9beee5b3cea5bb3dc3265d8e2.tar.gz monzero-gui-86f5aae63dd4e7e9beee5b3cea5bb3dc3265d8e2.tar.xz monzero-gui-86f5aae63dd4e7e9beee5b3cea5bb3dc3265d8e2.zip | |
cmake: fix MacOS linking (-rpath, -bind_at_load, -dead_strip, etc.)
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 71fca00e..92b7785d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,6 +238,7 @@ if(APPLE) if(CMAKE_PREFIX_PATH) include_directories(${CMAKE_PREFIX_PATH}/include) + set(CMAKE_BUILD_RPATH "${CMAKE_PREFIX_PATH}/lib") endif() endif() @@ -455,6 +456,11 @@ if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VER endif() # linker +if (APPLE) + add_linker_flag_if_supported(-Wl,-bind_at_load LD_SECURITY_FLAGS) + add_linker_flag_if_supported(-Wl,-dead_strip LD_SECURITY_FLAGS) + add_linker_flag_if_supported(-Wl,-dead_strip_dylibs LD_SECURITY_FLAGS) +endif() if (NOT APPLE AND NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU")) # Windows binaries die on startup with PIE when compiled with GCC add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS) |
