summaryrefslogtreecommitdiffstats
path: root/Modules/WriteCompilerDetectionHeader.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/WriteCompilerDetectionHeader.cmake')
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake43
1 files changed, 34 insertions, 9 deletions
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 5100035..5e6828f 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -5,6 +5,10 @@
WriteCompilerDetectionHeader
----------------------------
+.. deprecated:: 3.20
+ This module is available only if policy :policy:`CMP0120`
+ is not set to ``NEW``. Do not use it in new code.
+
.. versionadded:: 3.1
This module provides the function ``write_compiler_detection_header()``.
@@ -80,19 +84,28 @@ Possible compiler identifiers are documented with the
Available features in this version of CMake are listed in the
:prop_gbl:`CMAKE_C_KNOWN_FEATURES` and
:prop_gbl:`CMAKE_CXX_KNOWN_FEATURES` global properties.
-The ``{c,cxx}_std_*`` meta-features are ignored if requested.
-
See the :manual:`cmake-compile-features(7)` manual for information on
compile features.
-``BARE_FEATURES`` will define the compatibility macros with the name used in
-newer versions of the language standard, so the code can use the new feature
-name unconditionally.
+.. versionadded:: 3.2
+ Added ``MSVC`` and ``AppleClang`` compiler support.
+
+.. versionadded:: 3.6
+ Added ``Intel`` compiler support.
+
+.. versionchanged:: 3.8
+ The ``{c,cxx}_std_*`` meta-features are ignored if requested.
-``ALLOW_UNKNOWN_COMPILERS`` and ``ALLOW_UNKNOWN_COMPILER_VERSIONS`` cause
-the module to generate conditions that treat unknown compilers as simply
-lacking all features. Without these options the default behavior is to
-generate a ``#error`` for unknown compilers and versions.
+.. versionadded:: 3.8
+ ``ALLOW_UNKNOWN_COMPILERS`` and ``ALLOW_UNKNOWN_COMPILER_VERSIONS`` cause
+ the module to generate conditions that treat unknown compilers as simply
+ lacking all features. Without these options the default behavior is to
+ generate a ``#error`` for unknown compilers and versions.
+
+.. versionadded:: 3.12
+ ``BARE_FEATURES`` will define the compatibility macros with the name used in
+ newer versions of the language standard, so the code can use the new feature
+ name unconditionally.
Feature Test Macros
===================
@@ -234,6 +247,18 @@ library:
)
#]=======================================================================]
+# Guard against inclusion by absolute path.
+cmake_policy(GET CMP0120 _WCDH_policy)
+if(_WCDH_policy STREQUAL "NEW")
+ message(FATAL_ERROR "The WriteCompilerDetectionHeader module has been removed by policy CMP0120.")
+elseif(_WCDH_policy STREQUAL "")
+ message(AUTHOR_WARNING
+ "The WriteCompilerDetectionHeader module will be removed by policy CMP0120. "
+ "Projects should be ported away from the module, perhaps by bundling a copy "
+ "of the generated header or using a third-party alternative."
+ )
+endif()
+
include(${CMAKE_CURRENT_LIST_DIR}/CMakeCompilerIdDetection.cmake)
function(_load_compiler_variables CompilerId lang)