summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Hengen <jean-marc.hengen@zuehlke.com>2021-09-15 21:56:33 +0200
committerBrad King <brad.king@kitware.com>2021-09-16 08:30:51 -0400
commitf77ffbc0e3933dd1247fb20c364452fe0f4f1505 (patch)
tree2bd198f3882dd2a503a9b5002d4c27b75c4f3820
parent64aac043eed8a58e69b1b7952086cdfa73cd3cac (diff)
downloadcmake-f77ffbc0e3933dd1247fb20c364452fe0f4f1505.tar.gz
IAR: Restore support for projects not enabling policy CMP0057
Since commit 5b9bfe738c (IAR: Moved search logic to BinUtils., 2021-07-19, v3.21.1~14^2), we use the `IN_LIST` operator in the `CMakeFindBinUtils` module. Set policy `CMP0057` to ensure it is available regardless of the project's policy settings. Fixes: #22640
-rw-r--r--Modules/CMakeFindBinUtils.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index bb97f4a225..27d9131c83 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -20,6 +20,9 @@
# on UNIX, cygwin and mingw
+cmake_policy(PUSH)
+cmake_policy(SET CMP0057 NEW) # if IN_LIST
+
# Resolve full path of CMAKE_TOOL from user-defined name and SEARCH_PATH.
function(__resolve_tool_path CMAKE_TOOL SEARCH_PATH DOCSTRING)
@@ -240,3 +243,5 @@ if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^xIAR$")
set(CMAKE_IAR_LINKER "${CMAKE_LINKER}" CACHE FILEPATH "The IAR ILINK linker")
mark_as_advanced(CMAKE_IAR_LINKER CMAKE_IAR_AR)
endif()
+
+cmake_policy(POP)