llvm.org GIT mirror llvm / 4d1a925
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 Hans Wennborg 6 years ago
2 changed file(s) with 8 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
1919 option(LLVM_USE_FOLDERS "Enable solution folders in Visual Studio. Disable for Express versions." ON)
2020 if ( LLVM_USE_FOLDERS )
2121 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
22 endif()
23
24 if(MSVC AND NOT (${CMAKE_VERSION} VERSION_LESS 2.8.11))
25 # set stack reserved size to ~10MB
26 # CMake previously automatically set this value for MSVC builds, but the
27 # behavior was changed in CMake 2.8.11 (Issue 12437) to use the MSVC default
28 # value (1 MB) which is not enough for us in tasks such as parsing recursive
29 # C++ templates in Clang.
30 set(CMAKE_CXX_STACK_SIZE "10000000")
3122 endif()
3223
3324 include(VersionFromVCS)
152152 if( MSVC )
153153 include(ChooseMSVCCRT)
154154
155 # Visual C++ default stack size is 1MB. This is not enough for clang to
156 # instantiate templates up to the default maximum depth allowed, 256.
157 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -STACK:2097152")
155 if( NOT (${CMAKE_VERSION} VERSION_LESS 2.8.11) )
156 # set stack reserved size to ~10MB
157 # CMake previously automatically set this value for MSVC builds, but the
158 # behavior was changed in CMake 2.8.11 (Issue 12437) to use the MSVC default
159 # value (1 MB) which is not enough for us in tasks such as parsing recursive
160 # C++ templates in Clang.
161 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10000000")
162 endif()
158163
159164 if( MSVC10 )
160165 # MSVC 10 will complain about headers in the STL not being exported, but