Skip to content

Commit f924273

Browse files
Nuullllbashbaug
andauthored
Enable LARGEADDRESSAWARE for 32 bit compilation (KhronosGroup#1858)
* Enable LARGEADDRESSAWARE for 32 bit compilation 32-bit executables built with MSVC linker have only 2GB virtual memory address space by default, which might not be sufficient for some tests. Enable LARGEADDRESSAWARE linker flag for 32-bit targets to allow tests to handle addresses larger than 2 gigabytes. https://learn.microsoft.com/en-us/cpp/build/reference/largeaddressaware-handle-large-addresses?view=msvc-170 Signed-off-by: Guo, Yilong <[email protected]> * Apply suggestion Co-authored-by: Ben Ashbaugh <[email protected]> --------- Signed-off-by: Guo, Yilong <[email protected]> Co-authored-by: Ben Ashbaugh <[email protected]>
1 parent ebe8aa0 commit f924273

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ if( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" )
157157
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qlong-double -Qpc80 /DWIN32 /D_WINDOWS /W3 /GR /EHsc -nologo -Od -D_CRT_NONSTDC_NO_WARNINGS -EHsc -Wall -Qdiag-disable:68,111,177,186,161,869,1028,2259,2553,181,239,265,1188 -fp:strict -fp:source")
158158
endif()
159159

160+
# To handle addresses larger than 2 gigabytes for 32bit targets
161+
if(WIN32 AND ${CLConform_TARGET_ARCH} STREQUAL "x86")
162+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
163+
endif()
164+
160165
list(APPEND CLConform_LIBRARIES ${OPENCL_LIBRARIES})
161166
if(ANDROID)
162167
list(APPEND CLConform_LIBRARIES m)

0 commit comments

Comments
 (0)