summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-07-15 16:18:37 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-07-15 16:18:37 (GMT)
commit6d80f6645644c52dd5452202667e3af22b47d4b0 (patch)
treefe4424ba24163c7493b7d925948a680f654a634b /Modules
parentae9bff8e208f0ff071388148140062f70e574e24 (diff)
downloadCMake-6d80f6645644c52dd5452202667e3af22b47d4b0.zip
CMake-6d80f6645644c52dd5452202667e3af22b47d4b0.tar.gz
CMake-6d80f6645644c52dd5452202667e3af22b47d4b0.tar.bz2
ENH: do not use /INCREMENTAL:YES with VS 10 compiler
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Windows-cl.cmake20
1 files changed, 16 insertions, 4 deletions
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index 562b2b0..f8ba170 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -103,6 +103,9 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles")
SET(MSVC90 1)
SET(MSVC80 0)
ENDIF("${compilerVersion}" GREATER 1500)
+ IF("${compilerVersion}" EQUAL 1600)
+ SET(MSVC10 1)
+ ENDIF()
SET(MSVC_VERSION "${compilerVersion}")
ELSE(NOT CMAKE_COMPILER_RETURN)
MESSAGE(STATUS "Check for CL compiler version - failed")
@@ -168,6 +171,9 @@ IF(CMAKE_FORCE_WIN64)
SET(CMAKE_CL_64 1)
ENDIF(CMAKE_FORCE_WIN64)
+IF("${MSVC_VERSION}" GREATER 1599)
+ SET(MSVC_INCREMENTAL_DEFAULT ON)
+ENDIF()
# default to Debug builds
IF(MSVC_VERSION GREATER 1310)
@@ -239,12 +245,18 @@ ENDIF(CMAKE_CL_64)
# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp
# on versions that support it
+SET( MSVC_INCREMENTAL_YES_FLAG "")
+IF(NOT MSVC_INCREMENTAL_DEFAULT)
+ SET( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
+ENDIF()
+message("MSVC_INCREMENTAL_YES_FLAG = ${MSVC_INCREMENTAL_YES_FLAG}")
+
IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept /INCREMENTAL:YES")
- SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept /INCREMENTAL:YES")
+ SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
+ SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /INCREMENTAL:YES")
- SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /INCREMENTAL:YES")
+ SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
+ SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
# for release and minsize release default to no incremental linking
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO")