diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d97899..c70d8b15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,10 @@ set(CMAKE_C_STANDARD 11) include(GenerateExportHeader) set(CMAKE_CXX_FLAGS "-Wall -pedantic -fstack-protector-strong --param=ssp-buffer-size=4 ${CMAKE_CXX_FLAGS}") -if(WIN32) +# Increases the stack size to 8MB for Windows, only when not building in Debug mode +# because we don't want random users being affected by stack overflows in release builds, +# but it's fine in debug builds for finding and fixing them +if((NOT CMAKE_BUILD_TYPE STREQUAL "Debug") AND WIN32) set(CMAKE_EXE_LINKER_FLAGS "-Wl,--stack,8388608 ${CMAKE_EXE_LINKER_FLAGS}") endif()