summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-12-09 14:25:00 +0000
committerJose Fonseca <jfonseca@vmware.com>2016-12-09 14:25:00 +0000
commit849af14927410b5cd8a9597a39bd7f636ae54644 (patch)
tree20922311f42372b111b839ea5cd078ef0ca1dfb5
parentdd8dbd9337899bcc8e9d0a7d35d6c41883e03599 (diff)
cmake: Use more than 2GB for 32 bits Windows processes where available.
-rw-r--r--CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 24db020e..ba52e904 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -339,13 +339,23 @@ if (ENABLE_FRAME_POINTER)
endif ()
endif ()
-# Enable Data Execution Prevention and Address Space Layout Randomization
if (WIN32)
+ # Enable Data Execution Prevention and Address Space Layout Randomization
if (MSVC)
add_linker_flags (/NXCOMPAT /DYNAMICBASE)
else ()
add_linker_flags (-Wl,--nxcompat -Wl,--dynamicbase)
endif ()
+
+ # Use more than 2GB virtual memory address space for 32-bits processes
+ # where available (3GB on 32-bits Windows with 4GT, 4GB on 64-bits Windows)
+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+ if (MSVC)
+ add_linker_flags (/LARGEADDRESSAWARE)
+ else ()
+ add_linker_flags (-Wl,--large-address-aware)
+ endif ()
+ endif ()
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")