1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
From a18cc4c7cb51f94182b6018c7c73acde1b8ebddb Mon Sep 17 00:00:00 2001
From: "Tian, Shilei" <Shilei.Tian@amd.com>
Date: Mon, 14 Apr 2025 15:02:17 -0400
Subject: [PATCH] [DeviceLibs][CMake] Policy `CMP0053` is no longer supported
by CMake 4+ (#1519)
The part of the code needs to be refined; otherwise we will have
multiple breaks
after users upgrade to CMake 4 on Windows.
Applied-Upstream: https://github.com/ROCm/llvm-project/commit/a18cc4c7cb51f94182b6018c7c73acde1b8ebddb
---
amd/device-libs/cmake/OCL.cmake | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/amd/device-libs/cmake/OCL.cmake b/amd/device-libs/cmake/OCL.cmake
index 4f16d8cd81d7c..1dabde51b8c08 100644
--- a/amd/device-libs/cmake/OCL.cmake
+++ b/amd/device-libs/cmake/OCL.cmake
@@ -9,7 +9,10 @@
# command-lines, but the only way to do this as part of the dependency graph is
# configure_file and we are included from multiple places. To get around this
# we `file(WRITE)` a file with an @variable reference and `configure_file` it.
-cmake_policy(SET CMP0053 OLD)
+# FIXME: CMP0053 is removed in CMake 4; refine code relying on this policy.
+if(${CMAKE_VERSION} VERSION_LESS "4.0.0")
+ cmake_policy(SET CMP0053 OLD)
+endif()
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20.0")
# The policy change was for handling of relative paths for
|