aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJerry Zhang Jian <jerry.zhangjian@sifive.com>2024-07-02 01:37:11 +0800
committerGitHub <noreply@github.com>2024-07-02 02:37:11 +0900
commit9f3bfbb680e6cef9c5b902dac4ad541b99e1ea6a (patch)
tree8dfb0cc3d33143a0f15f59f07facfc23f3a71aac /cmake
parent1b704e889f09b5dfc0549786542bc6d2cd54e85b (diff)
downloadllvm-9f3bfbb680e6cef9c5b902dac4ad541b99e1ea6a.zip
llvm-9f3bfbb680e6cef9c5b902dac4ad541b99e1ea6a.tar.gz
llvm-9f3bfbb680e6cef9c5b902dac4ad541b99e1ea6a.tar.bz2
[CMake] enable CMP0144 policy if available (#96589)
- Enable CMP0144 policy if available, this will make the find_package() more robust. Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/CMakePolicy.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/Modules/CMakePolicy.cmake b/cmake/Modules/CMakePolicy.cmake
index 1c18c18..b696266 100644
--- a/cmake/Modules/CMakePolicy.cmake
+++ b/cmake/Modules/CMakePolicy.cmake
@@ -23,3 +23,9 @@ endif()
if(POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif()
+
+# CMP0144: find_package() uses uppercase <PackageName>_ROOT variables.
+# New in CMake 3.27: https://cmake.org/cmake/help/latest/policy/CMP0144.html
+if(POLICY CMP0144)
+ cmake_policy(SET CMP0144 NEW)
+endif()