From 51d96a1680815d30052cbe824bcbec4ecea3592e Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 23 Mar 2023 00:26:07 +0100
Subject: [PATCH] cmake: increase threshold for stack probes
The /Gs argument controls the number of bytes that local variables
can occupy before a stack probe is initiated.
By setting it to a huge value, no calls to __chkstk are inserted.
This change is needed for the classic Intel C compiler to build SDL
with -DSDL_LIBC=OFF.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e961050084f..02ef05d547ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1845,7 +1845,7 @@ elseif(WINDOWS)
if(MSVC AND NOT SDL_LIBC)
# Prevent codegen that would use the VC runtime libraries.
- set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/GS-")
+ set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/GS-;/Gs1048576")
if(SDL_CPU_X86)
set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/arch:SSE")
endif()