From 591e0c6195ab769e5fc96075ce48cb7c2a26407a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 27 Aug 2022 09:47:44 +0800 Subject: [PATCH] cmake: use a loop for setting new policies we were using a for loop for this purpose, but the for loop was unrolled when we bumped up the required cmake version. this change paves the road to setting "CMP0135" to "NEW". this policy is a new one introduced by CMake v3.24. Signed-off-by: Kefu Chai --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40c8b634258..df17fed6b15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,10 @@ cmake_policy(SET CMP0065 NEW) cmake_policy(SET CMP0074 NEW) cmake_policy(SET CMP0075 NEW) cmake_policy(SET CMP0093 NEW) -if(POLICY CMP0127) - cmake_policy(SET CMP0127 NEW) +foreach(policy CMP0127) + if(POLICY ${policy}) + cmake_policy(SET ${policy} NEW) + endif() endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") -- 2.39.5