diff options
-rw-r--r-- | Modules/Platform/Windows-cl.cmake | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 594029b..ba306ad 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -255,25 +255,39 @@ SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") +# set the stack size and the machine type IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:x64 /INCREMENTAL:YES") + SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:x64") ELSE(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:I386 /INCREMENTAL:YES") + SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:I386") ENDIF(CMAKE_CL_64) + +# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp +# on versions that support it IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE) - SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept") - SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept") + SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept /INCREMENTAL:YES") + SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept /INCREMENTAL:YES") ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE) - SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug") - SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug") + SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /INCREMENTAL:YES") + SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /INCREMENTAL:YES") ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE) +# for release and minsize release default to no incremental linking +SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO") +SET(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO") +# copy the EXE_LINKER flags to SHARED and MODULE linker flags +# shared linker flags SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT}) SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) +SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT}) +SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT}) +# module linker flags SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT}) SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT}) SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT}) +SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT}) +SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT}) # save computed information for this platform |