Set CMake policy CMP0074 to the new behaviour in hip package (#48549)

This commit is contained in:
Mikael Simberg 2025-01-14 12:48:09 +01:00 committed by GitHub
parent d89ae7bcde
commit aa88ced154
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -597,6 +597,12 @@ def cmake_args(self):
# should find llvm-amdgpu
self.define("LLVM_ROOT", self.spec["llvm-amdgpu"].prefix),
self.define("Clang_ROOT", self.spec["llvm-amdgpu"].prefix),
# Use the new behaviour of the policy CMP0074
# (https://cmake.org/cmake/help/latest/policy/CMP0074.html) which will search
# "prefixes specified by the <PackageName>_ROOT CMake variable".
# From HIP 6.2 onwards the policy is set explicitly by HIP itself:
# https://github.com/ROCm/clr/commit/a2a8dad980b0fa1a6086e0c0f95847ae80f5a2c6.
self.define("CMAKE_POLICY_DEFAULT_CMP0074", "NEW"),
]
if self.spec.satisfies("+rocm"):
args.append(self.define("HSA_PATH", self.spec["hsa-rocr-dev"].prefix))