Просмотр исходного кода

Merge topic 'use_block'

f3e85754b4 Modules:Check*: refactor: use block(SCOPE_FOR POLICIES)

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !8303
Brad King 2 лет назад
Родитель
Сommit
bf3071a890

+ 2 - 2
Modules/CheckLanguage.cmake

@@ -36,7 +36,7 @@ Example:
 
 include_guard(GLOBAL)
 
-cmake_policy(PUSH)
+block(SCOPE_FOR POLICIES)
 cmake_policy(SET CMP0126 NEW)
 
 macro(check_language lang)
@@ -114,4 +114,4 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
   endif()
 endmacro()
 
-cmake_policy(POP)
+endblock()

+ 2 - 2
Modules/CheckSymbolExists.cmake

@@ -62,7 +62,7 @@ For example:
 
 include_guard(GLOBAL)
 
-cmake_policy(PUSH)
+block(SCOPE_FOR POLICIES)
 cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
 
 macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
@@ -166,4 +166,4 @@ int main(int argc, char** argv)
   endif()
 endmacro()
 
-cmake_policy(POP)
+endblock()

+ 2 - 2
Modules/CheckTypeSize.cmake

@@ -92,7 +92,7 @@ get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
 
 include_guard(GLOBAL)
 
-cmake_policy(PUSH)
+block(SCOPE_FOR POLICIES)
 cmake_policy(SET CMP0054 NEW)
 
 #-----------------------------------------------------------------------------
@@ -294,4 +294,4 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE)
 endmacro()
 
 #-----------------------------------------------------------------------------
-cmake_policy(POP)
+endblock()

+ 3 - 2
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()

+ 2 - 2
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()

+ 2 - 2
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()

+ 2 - 2
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()

+ 2 - 2
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()