diff options
-rw-r--r-- | Modules/Platform/Windows-cl.cmake | 20 |
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") |