summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/release/dev/frontend-variant-always.rst6
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_FRONTEND_VARIANT.rst4
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake6
3 files changed, 15 insertions, 1 deletions
diff --git a/Help/release/dev/frontend-variant-always.rst b/Help/release/dev/frontend-variant-always.rst
new file mode 100644
index 0000000..111175c
--- /dev/null
+++ b/Help/release/dev/frontend-variant-always.rst
@@ -0,0 +1,6 @@
+frontend-variant-always
+-----------------------
+
+* The :variable:`CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT` variable is now
+ set for ``GNU``, ``MSVC``, and ``AppleClang`` compilers that have only
+ one frontend variant.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_FRONTEND_VARIANT.rst b/Help/variable/CMAKE_LANG_COMPILER_FRONTEND_VARIANT.rst
index 128b1fb..a414463 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_FRONTEND_VARIANT.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_FRONTEND_VARIANT.rst
@@ -16,3 +16,7 @@ the compiler whose frontend it resembles.
.. note::
In other words, this variable describes what command line options
and language extensions the compiler frontend expects.
+
+.. versionchanged:: 3.26
+ This variable is set for ``GNU``, ``MSVC``, and ``AppleClang``
+ compilers that have only one frontend variant.
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()