mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-21 22:50:26 -06:00
WriteCompilerDetectionHeader: Add policy to remove module
See justification in the policy documentation. Closes: #17842
This commit is contained in:
@@ -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()``.
|
||||
@@ -243,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)
|
||||
|
||||
Reference in New Issue
Block a user