summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2013-10-17 18:39:47 +0000
committerHans Wennborg <hans@hanshq.net>2013-10-17 18:39:47 +0000
commit4d1a9256752048f34c6091cc145fce9f89d20985 (patch)
tree1cb3d17019bb7210624535a58feaa4627e485575 /cmake
parentb75fcecb0ff2f22e79454ce9ed7c246792bdbf0d (diff)
downloadexternal_llvm-4d1a9256752048f34c6091cc145fce9f89d20985.zip
external_llvm-4d1a9256752048f34c6091cc145fce9f89d20985.tar.gz
external_llvm-4d1a9256752048f34c6091cc145fce9f89d20985.tar.bz2
CMake: set stack size for MSVC in just one place
After r192904, Reid pointed out he thought we already set the stack size for MSVC. Turns out we did, but it didn't seem to work. This commit sets the stack size in a single place, using CMAKE_EXE_LINKER_FLAGS because that seems to be the way that works best. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake11
1 files changed, 8 insertions, 3 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 4063429..7a45559 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -153,9 +153,14 @@ endif()
if( MSVC )
include(ChooseMSVCCRT)
- # Visual C++ default stack size is 1MB. This is not enough for clang to
- # instantiate templates up to the default maximum depth allowed, 256.
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -STACK:2097152")
+ if( NOT (${CMAKE_VERSION} VERSION_LESS 2.8.11) )
+ # set stack reserved size to ~10MB
+ # CMake previously automatically set this value for MSVC builds, but the
+ # behavior was changed in CMake 2.8.11 (Issue 12437) to use the MSVC default
+ # value (1 MB) which is not enough for us in tasks such as parsing recursive
+ # C++ templates in Clang.
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10000000")
+ endif()
if( MSVC10 )
# MSVC 10 will complain about headers in the STL not being exported, but