diff options
author | Brad King <brad.king@kitware.com> | 2017-11-15 19:44:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-11-15 19:58:44 (GMT) |
commit | 3bc21a70b5c026d2dfe400ea3180f33bbaf529ea (patch) | |
tree | c7124f457c8fa4a5f49dd66d6bcece67f0af92c0 /Modules | |
parent | 1fe9e49bad0ad4f540ceda028106d9af89084946 (diff) | |
download | CMake-3bc21a70b5c026d2dfe400ea3180f33bbaf529ea.zip CMake-3bc21a70b5c026d2dfe400ea3180f33bbaf529ea.tar.gz CMake-3bc21a70b5c026d2dfe400ea3180f33bbaf529ea.tar.bz2 |
MSVC: Fix MSVC_VERSION when mixing MSVC C/C++ with Intel Fortran
When using a real MSVC compiler for `C` or `CXX`, use the version of
that compiler for `MSVC_VERSION`. This is preferred over the MSVC
version that a non-MSVC compiler "simulates".
Fixes: #17468
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 4719563..0737c12 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -48,7 +48,11 @@ else() endif() if(NOT MSVC_VERSION) - if(CMAKE_C_SIMULATE_VERSION) + if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xMSVC") + set(_compiler_version ${CMAKE_C_COMPILER_VERSION}) + elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") + set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION}) + elseif(CMAKE_C_SIMULATE_VERSION) set(_compiler_version ${CMAKE_C_SIMULATE_VERSION}) elseif(CMAKE_CXX_SIMULATE_VERSION) set(_compiler_version ${CMAKE_CXX_SIMULATE_VERSION}) |