diff options
author | Janek Bevendorff <janek@jbev.net> | 2018-05-09 20:25:58 +0300 |
---|---|---|
committer | Janek Bevendorff <janek@jbev.net> | 2018-05-09 20:25:58 +0300 |
commit | b02bd59e0ca1f04315415fddbf6c1411751ab34f (patch) | |
tree | c1a67c3cb99b6d4769fc2858a198c2e253287d03 /CMakeLists.txt | |
parent | aae6d09fd3a37077ba2c842079ac76a256445bce (diff) | |
parent | 0a155d89a3bb67676b0c993fb1eda4317e7b473c (diff) |
Merge branch 'master' into develop
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a33ea2417..a4cb4d1fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,7 +62,7 @@ set(CMAKE_AUTOUIC ON) set(KEEPASSXC_VERSION_MAJOR "2") set(KEEPASSXC_VERSION_MINOR "3") -set(KEEPASSXC_VERSION_PATCH "2") +set(KEEPASSXC_VERSION_PATCH "3") set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION_MAJOR}.${KEEPASSXC_VERSION_MINOR}.${KEEPASSXC_VERSION_PATCH}") set(KEEPASSXC_BUILD_TYPE "Snapshot" CACHE STRING "Set KeePassXC build type to distinguish between stable releases and snapshots") @@ -117,6 +117,10 @@ elseif(KEEPASSXC_DIST_TYPE STREQUAL "Other") unset(KEEPASSXC_DIST) endif() +if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") + set(IS_32BIT TRUE) +endif() + if("${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_COMPILER_IS_CLANG 1) endif() @@ -237,8 +241,13 @@ if(MINGW) set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>") if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) # Enable DEP and ASLR - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase -Wl,--high-entropy-va") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase -Wl,--high-entropy-va") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase") + # Enable high entropy ASLR for 64-bit builds + if(NOT IS_32BIT) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--high-entropy-va") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--high-entropy-va") + endif() endif() endif() |