[PATCH] D99616: [CMake] Explicitly set CMP0116 policy

Jean-Michel Gorius via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 13:04:50 PDT 2021


Kayjukh created this revision.
Kayjukh added reviewers: chandlerc, stephenneuendorffer.
Herald added a subscriber: mgorny.
Kayjukh requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

CMake 3.20.0 introduces a new policy that allows us to specify the
behavior of the DEPFILE argument to add_custom_command() for Ninja
builds. Setting this policy to OLD makes DEPFILE be either an absolute
path or a path relative to CMAKE_BINARY_DIR. In contrast, the NEW
behavior makes the path absolute or relative to CMAKE_CURRENT_BINARY_DIR.

CMake only emits a warning because DEPFILE is used in a subdirectory. If
it were not, the build would default to the OLD behavior. Explicitly set
the policy to OLD to silence this warning for Ninja builds.

Additional information: cmake --help-policy CMP0116


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99616

Files:
  llvm/CMakeLists.txt


Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -4,6 +4,8 @@
 
 set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
 
+cmake_policy(SET CMP0116 OLD)
+
 if(NOT DEFINED LLVM_VERSION_MAJOR)
   set(LLVM_VERSION_MAJOR 13)
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99616.334252.patch
Type: text/x-patch
Size: 314 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210330/9e978c9f/attachment.bin>


More information about the llvm-commits mailing list