Skip to content

Commit 7a27338

Browse files
committed
Making Windows executable large address aware
In some cases the (not supported!) 32-bit Windows executables stop to work due to exceeding of the memory limit that can be addressed by the executable. This can be overcome by setting the `/LARGEADDRESSAWARE` flag. With the 64-bit Windows executable this flag is already automatically set see also: https://docs.microsoft.com/en-us/cpp/build/reference/largeaddressaware-handle-large-addresses?view=msvc-170).
1 parent db073db commit 7a27338

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ if (WIN32)
8282
set(CMAKE_REQUIRED_DEFINITIONS "-DLIBICONV_STATIC")
8383
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # needed for language.cpp on 64bit
8484
add_definitions(-DLIBICONV_STATIC -D_CRT_SECURE_NO_WARNINGS)
85+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
8586
endif()
8687
if (CMAKE_GENERATOR MATCHES "NMake Makefiles")
8788
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")

0 commit comments

Comments
 (0)