diff options
Diffstat (limited to 'Modules/Platform/Windows-MSVC.cmake')
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 7036ba0..e29aaf4 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -65,7 +65,13 @@ else() endif() if(NOT MSVC_VERSION) - if(CMAKE_C_COMPILER_VERSION) + if(CMAKE_C_SIMULATE_VERSION) + set(_compiler_version ${CMAKE_C_SIMULATE_VERSION}) + elseif(CMAKE_CXX_SIMULATE_VERSION) + set(_compiler_version ${CMAKE_CXX_SIMULATE_VERSION}) + elseif(CMAKE_Fortran_SIMULATE_VERSION) + set(_compiler_version ${CMAKE_Fortran_SIMULATE_VERSION}) + elseif(CMAKE_C_COMPILER_VERSION) set(_compiler_version ${CMAKE_C_COMPILER_VERSION}) else() set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION}) @@ -178,12 +184,15 @@ set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") # executable linker flags set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") # set the machine type -set(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID}) -if(NOT _MACHINE_ARCH_FLAG) - set(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID}) +if(MSVC_C_ARCHITECTURE_ID) + set(_MACHINE_ARCH_FLAG "/machine:${MSVC_C_ARCHITECTURE_ID}") +elseif(MSVC_CXX_ARCHITECTURE_ID) + set(_MACHINE_ARCH_FLAG "/machine:${MSVC_CXX_ARCHITECTURE_ID}") +elseif(MSVC_Fortran_ARCHITECTURE_ID) + set(_MACHINE_ARCH_FLAG "/machine:${MSVC_Fortran_ARCHITECTURE_ID}") endif() -set (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${_MACHINE_ARCH_FLAG}") +set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} ${_MACHINE_ARCH_FLAG}") +unset(_MACHINE_ARCH_FLAG) # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype # on versions that support it @@ -220,7 +229,7 @@ set (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INI set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT}) macro(__windows_compiler_msvc lang) - if(NOT "${CMAKE_${lang}_COMPILER_VERSION}" VERSION_LESS 14) + if(NOT MSVC_VERSION LESS 1400) # for 2005 make sure the manifest is put in the dll with mt set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll ") set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe ") @@ -232,7 +241,7 @@ macro(__windows_compiler_msvc lang) set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") set(CMAKE_${lang}_COMPILE_OBJECT - "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<OBJECT_DIR>/ -c <SOURCE>${CMAKE_END_TEMP_FILE}") + "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<OBJECT_DIR>/${_FS_${lang}} -c <SOURCE>${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE |