summaryrefslogtreecommitdiff
path: root/Modules/Internal
diff options
context:
space:
mode:
authorscivision <scivision@users.noreply.github.com>2023-03-08 13:25:05 -0500
committerscivision <scivision@users.noreply.github.com>2023-03-08 14:07:55 -0500
commitf3e85754b4ab3ed8322ce256626bdf2d69c5e647 (patch)
tree04795af4eaf97a8ef0c7d1e88541e49661a4af2f /Modules/Internal
parenta4e7b4d75a0b079d468726f4e4a772cbbd4aab82 (diff)
downloadcmake-f3e85754b4ab3ed8322ce256626bdf2d69c5e647.tar.gz
Modules:Check*: refactor: use block(SCOPE_FOR POLICIES)
Diffstat (limited to 'Modules/Internal')
-rw-r--r--Modules/Internal/CheckFlagCommonConfig.cmake5
-rw-r--r--Modules/Internal/CheckLinkerFlag.cmake4
-rw-r--r--Modules/Internal/CheckSourceCompiles.cmake4
-rw-r--r--Modules/Internal/CheckSourceRuns.cmake4
-rw-r--r--Modules/Internal/HeaderpadWorkaround.cmake4
5 files changed, 11 insertions, 10 deletions
diff --git a/Modules/Internal/CheckFlagCommonConfig.cmake b/Modules/Internal/CheckFlagCommonConfig.cmake
index 61eada2ae8..744f1f1052 100644
--- a/Modules/Internal/CheckFlagCommonConfig.cmake
+++ b/Modules/Internal/CheckFlagCommonConfig.cmake
@@ -7,7 +7,8 @@
# It's content may change in any way between releases.
include_guard(GLOBAL)
-cmake_policy(PUSH)
+
+block(SCOPE_FOR POLICIES)
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
@@ -70,4 +71,4 @@ macro(CMAKE_CHECK_FLAG_COMMON_FINISH)
endforeach()
endmacro()
-cmake_policy(POP)
+endblock()
diff --git a/Modules/Internal/CheckLinkerFlag.cmake b/Modules/Internal/CheckLinkerFlag.cmake
index 7613105500..b872b5121e 100644
--- a/Modules/Internal/CheckLinkerFlag.cmake
+++ b/Modules/Internal/CheckLinkerFlag.cmake
@@ -6,7 +6,7 @@ include(Internal/CheckFlagCommonConfig)
include(Internal/CheckSourceCompiles)
include(CMakeCheckCompilerFlagCommonPatterns)
-cmake_policy(PUSH)
+block(SCOPE_FOR POLICIES)
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
function(CMAKE_CHECK_LINKER_FLAG _lang _flag _var)
@@ -49,4 +49,4 @@ function(CMAKE_CHECK_LINKER_FLAG _lang _flag _var)
cmake_check_flag_common_finish()
endfunction()
-cmake_policy(POP)
+endblock()
diff --git a/Modules/Internal/CheckSourceCompiles.cmake b/Modules/Internal/CheckSourceCompiles.cmake
index 83d7020df5..14a9a61a87 100644
--- a/Modules/Internal/CheckSourceCompiles.cmake
+++ b/Modules/Internal/CheckSourceCompiles.cmake
@@ -3,7 +3,7 @@
include_guard(GLOBAL)
-cmake_policy(PUSH)
+block(SCOPE_FOR POLICIES)
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
@@ -131,4 +131,4 @@ function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var)
endif()
endfunction()
-cmake_policy(POP)
+endblock()
diff --git a/Modules/Internal/CheckSourceRuns.cmake b/Modules/Internal/CheckSourceRuns.cmake
index 805d98d89c..c01081eb98 100644
--- a/Modules/Internal/CheckSourceRuns.cmake
+++ b/Modules/Internal/CheckSourceRuns.cmake
@@ -3,7 +3,7 @@
include_guard(GLOBAL)
-cmake_policy(PUSH)
+block(SCOPE_FOR POLICIES)
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
@@ -124,4 +124,4 @@ function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var)
endif()
endfunction()
-cmake_policy(POP)
+endblock()
diff --git a/Modules/Internal/HeaderpadWorkaround.cmake b/Modules/Internal/HeaderpadWorkaround.cmake
index 9a7f9f57e4..fccfaae4a6 100644
--- a/Modules/Internal/HeaderpadWorkaround.cmake
+++ b/Modules/Internal/HeaderpadWorkaround.cmake
@@ -9,7 +9,7 @@ if(NOT APPLE)
return()
endif()
-cmake_policy(PUSH)
+block(SCOPE_FOR POLICIES)
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
function(__cmake_internal_workaround_headerpad_flag_conflict _LANG)
@@ -66,4 +66,4 @@ endforeach()
unset(__lang)
unset(__enabled_languages)
-cmake_policy(POP)
+endblock()