diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2020-09-07 15:04:30 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2020-09-07 15:04:30 -0500 |
| commit | 121904f34071ce3e21ff65c978f6f687a234bfb5 (patch) | |
| tree | 63432569ae7d23945a8fa03bac8fa68bb38f924e | |
| parent | 05f63a24ccfc6f5917142668f7cf1cc5225f8b2c (diff) | |
| parent | 86f5aae63dd4e7e9beee5b3cea5bb3dc3265d8e2 (diff) | |
| download | monzero-gui-121904f34071ce3e21ff65c978f6f687a234bfb5.tar.gz monzero-gui-121904f34071ce3e21ff65c978f6f687a234bfb5.tar.xz monzero-gui-121904f34071ce3e21ff65c978f6f687a234bfb5.zip | |
Merge pull request #3056
86f5aae cmake: fix MacOS linking (-rpath, -bind_at_load, -dead_strip, etc.) (xiphon)
| -rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f096fe33..e6ea4ab8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,6 +241,7 @@ if(APPLE) if(CMAKE_PREFIX_PATH) include_directories(${CMAKE_PREFIX_PATH}/include) + set(CMAKE_BUILD_RPATH "${CMAKE_PREFIX_PATH}/lib") endif() endif() @@ -464,6 +465,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) |
