summaryrefslogtreecommitdiffstats
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
commitbef50abea92627bd6941e367fb86347edb72bd8c (patch)
tree6831349ca7a5cfcaf5f9089cbbbe1fb1e343613a
parent6501320e723a63bcbadf49c9e9dd4cfde904619e (diff)
downloadbcm5719-llvm-bef50abea92627bd6941e367fb86347edb72bd8c.tar.gz
bcm5719-llvm-bef50abea92627bd6941e367fb86347edb72bd8c.zip
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. llvm-svn: 192912
-rw-r--r--llvm/CMakeLists.txt9
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake11
2 files changed, 8 insertions, 12 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 17ef03aaf9a..f85b6cc3633 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -22,15 +22,6 @@ if ( LLVM_USE_FOLDERS )
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
-if(MSVC AND 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_CXX_STACK_SIZE "10000000")
-endif()
-
include(VersionFromVCS)
option(LLVM_APPEND_VC_REV
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 40634294061..7a455594c59 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/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
OpenPOWER on IntegriCloud