diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2020-03-10 18:48:01 -0400 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2020-03-10 18:48:01 -0400 |
| commit | eee48ce74c520f2c6fe396788f591849747b5246 (patch) | |
| tree | afa7f7d30aa0e88cb414874a5f6a1c3f9a8e2b33 | |
| parent | 9072f89a4eef28be74cbd72353b884903fe21c52 (diff) | |
| parent | b739cdd52abdc0d6746bc16865d2d2a2137d6ab2 (diff) | |
| download | monzero-gui-eee48ce74c520f2c6fe396788f591849747b5246.tar.gz monzero-gui-eee48ce74c520f2c6fe396788f591849747b5246.tar.xz monzero-gui-eee48ce74c520f2c6fe396788f591849747b5246.zip | |
Merge pull request #2797
b739cdd cmake: -static, -static-libgcc, -static-libstdc++ linker flags (xiphon)
| -rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 35b96e57..6d43510d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -384,13 +384,22 @@ if (noexecheap_SUPPORTED) set(LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecheap") endif() +if(STATIC) + if(MINGW) + add_linker_flag_if_supported(-static STATIC_FLAGS) + else() + add_linker_flag_if_supported(-static-libgcc STATIC_FLAGS) + add_linker_flag_if_supported(-static-libstdc++ STATIC_FLAGS) + endif() +endif() + message(STATUS "Using C security hardening flags: ${C_SECURITY_FLAGS}") message(STATUS "Using C++ security hardening flags: ${CXX_SECURITY_FLAGS}") message(STATUS "Using linker security hardening flags: ${LD_SECURITY_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_SECURITY_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_SECURITY_FLAGS}") -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${STATIC_FLAGS}") if (HIDAPI_FOUND OR LibUSB_COMPILE_TEST_PASSED) if (APPLE) |
