diff options
author | Russell Greene <russell@shotover.com> | 2022-12-20 01:12:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-01-11 19:50:40 (GMT) |
commit | e4fcdfa3010d097c81035aea9a18ed08b359bf38 (patch) | |
tree | ec0c1818f12944bc709b5405f147a2c1804b36fe /Modules/CMakeDetermineCompilerId.cmake | |
parent | 555a892a69a744c4f7513952a0eff191bf4619cd (diff) | |
download | CMake-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.cmake | 6 |
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() |