diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-10-24 06:31:37 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-10-28 08:46:48 +0200 |
commit | 9dd01a5241dc5b46e92485e05bc345221df8938c (patch) | |
tree | 71a61990dcfd564a665087a953547e77d7b0d679 /cmake | |
parent | fecf067db40ffa1a6d5d665769c90cd29547f502 (diff) | |
download | llvm-9dd01a5241dc5b46e92485e05bc345221df8938c.zip llvm-9dd01a5241dc5b46e92485e05bc345221df8938c.tar.gz llvm-9dd01a5241dc5b46e92485e05bc345221df8938c.tar.bz2 |
Harmonize cmake_policy() across standalone builds of all projects
Move `cmake_policy()` settings from `llvm/CMakeLists.txt` into a shared
`cmake/modules/CMakePolicy.cmake`. Include it from all relevant
projects that support standalone builds, in order to ensure that
the policies are consistently set whether they are built in-tree
or stand-alone.
Differential Revision: https://reviews.llvm.org/D136572
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/CMakePolicy.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/Modules/CMakePolicy.cmake b/cmake/Modules/CMakePolicy.cmake new file mode 100644 index 0000000..0ec32ad --- /dev/null +++ b/cmake/Modules/CMakePolicy.cmake @@ -0,0 +1,12 @@ +# CMake policy settings shared between LLVM projects + +# CMP0114: ExternalProject step targets fully adopt their steps. +# New in CMake 3.19: https://cmake.org/cmake/help/latest/policy/CMP0114.html +if(POLICY CMP0114) + cmake_policy(SET CMP0114 OLD) +endif() +# CMP0116: Ninja generators transform `DEPFILE`s from `add_custom_command()` +# New in CMake 3.20. https://cmake.org/cmake/help/latest/policy/CMP0116.html +if(POLICY CMP0116) + cmake_policy(SET CMP0116 OLD) +endif() |