summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorRussell Greene <russell@shotover.com>2022-12-20 01:12:01 (GMT)
committerBrad King <brad.king@kitware.com>2023-01-11 19:50:40 (GMT)
commite4fcdfa3010d097c81035aea9a18ed08b359bf38 (patch)
treeec0c1818f12944bc709b5405f147a2c1804b36fe /Modules/CMakeDetermineCompilerId.cmake
parent555a892a69a744c4f7513952a0eff191bf4619cd (diff)
downloadCMake-e4fcdfa3010d097c81035aea9a18ed08b359bf38.zip
CMake-e4fcdfa3010d097c81035aea9a18ed08b359bf38.tar.gz
CMake-e4fcdfa3010d097c81035aea9a18ed08b359bf38.tar.bz2
Set CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT on single-variant compilers
The `GNU` and `MSVC` compilers obviously use their own front-end command-line style. Also set this for `AppleClang`. Fixes: #24232
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 73c775a..7f392c8 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -243,8 +243,12 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
else()
set(CMAKE_${lang}_COMPILER_FRONTEND_VARIANT "GNU")
endif()
- elseif("x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xFujitsuClang")
+ elseif("x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xGNU"
+ OR "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xAppleClang"
+ OR "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xFujitsuClang")
set(CMAKE_${lang}_COMPILER_FRONTEND_VARIANT "GNU")
+ elseif("x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC")
+ set(CMAKE_${lang}_COMPILER_FRONTEND_VARIANT "MSVC")
else()
set(CMAKE_${lang}_COMPILER_FRONTEND_VARIANT "")
endif()