Browse Source

Windows: Increase stack size used by CMake binaries

Deep regex matching logic can exceed the default 1MB stack size.  Until
a better regex engine is used, simply push the problem over a farther
horizon by increasing the stack size when built using a MSVC-compatible
linker.

Issue: #17659
Brad King 7 years ago
parent
commit
c7cee1a11e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      CompileFlags.cmake

+ 4 - 0
CompileFlags.cmake

@@ -17,6 +17,10 @@ if(MSVC OR _INTEL_WINDOWS)
 else()
 else()
 endif()
 endif()
 
 
+if(MSVC)
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stack:10000000")
+endif()
+
 #silence duplicate symbol warnings on AIX
 #silence duplicate symbol warnings on AIX
 if(CMAKE_SYSTEM_NAME MATCHES "AIX")
 if(CMAKE_SYSTEM_NAME MATCHES "AIX")
   if(NOT CMAKE_COMPILER_IS_GNUCXX)
   if(NOT CMAKE_COMPILER_IS_GNUCXX)