diff options
author | Brad King <brad.king@kitware.com> | 2012-11-16 17:52:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-11-16 17:52:59 (GMT) |
commit | cd739794d65e1b0ebcf5fd0d713d3ecc08ee27fc (patch) | |
tree | 9fbac2982b3b8bace8ecae1176998b7e3b74422d /Modules | |
parent | c152c65898ef88233ef618a0283a0930e708da5e (diff) | |
download | CMake-cd739794d65e1b0ebcf5fd0d713d3ecc08ee27fc.zip CMake-cd739794d65e1b0ebcf5fd0d713d3ecc08ee27fc.tar.gz CMake-cd739794d65e1b0ebcf5fd0d713d3ecc08ee27fc.tar.bz2 |
MSVC: Drop default use of /Zm1000 for VS >= 7.1
From the option documentation of VS >= 7.1:
"In earlier versions of Visual C++, the compiler used several discrete
heaps, and each had a finite limit. Currently, the compiler dynamically
grows the heaps as necessary up to a total heap size limit, and requires
a fixed-size buffer only to construct precompiled headers. Consequently,
the /Zm compiler option is rarely necessary."
http://msdn.microsoft.com/en-us/library/bdscwf1c.aspx
Suggested-by: Adam Moss <adam@broadcom.com>
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 1f28c50..32dd546 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -154,6 +154,11 @@ else() set(_FLAGS_CXX " /GR /GX") set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") endif() + + if(MSVC_VERSION LESS 1310) + set(_FLAGS_C " /Zm1000${_FLAGS_C}") + set(_FLAGS_CXX " /Zm1000${_FLAGS_CXX}") + endif() endif() set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") @@ -233,7 +238,7 @@ macro(__windows_compiler_msvc lang) set(CMAKE_${lang}_LINK_EXECUTABLE "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> <OBJECTS> /link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") - set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}") + set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3${_FLAGS_${lang}}") set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}") set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG") set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG") |