<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54944>54944</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            cmake policy CMP0114
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            cmake
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          nickdesaulniers
      </td>
    </tr>
</table>

<pre>
    Doing a build of the 14.0.0 and 14.0.1 releases (I haven't tested older releases) produces a stream of warnings for me (for LLVM_ENABLE_RUNTIMES build):
```
CMake Warning (dev) at /usr/share/cmake/Modules/ExternalProject.cmake:2147 (message):
  Policy CMP0114 is not set: ExternalProject step targets fully adopt their
  steps.  Run "cmake --help-policy CMP0114" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  ExternalProject target 'builtins' would depend on the targets for step(s)
  'clean' under policy CMP0114, but this is being left out for compatibility
  since the policy is not set.
Call Stack (most recent call first):
  cmake/modules/LLVMExternalProjectUtils.cmake:345 (ExternalProject_Add_StepTargets)
  runtimes/CMakeLists.txt:82 (llvm_ExternalProject_Add)
  runtimes/CMakeLists.txt:140 (builtin_default_target)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/cmake/Modules/ExternalProject.cmake:2147 (message):
  Policy CMP0114 is not set: ExternalProject step targets fully adopt their
  steps.  Run "cmake --help-policy CMP0114" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  ExternalProject target 'runtimes' would depend on the targets for step(s)
  'clean' under policy CMP0114, but this is being left out for compatibility
  since the policy is not set.
Call Stack (most recent call first):
  cmake/modules/LLVMExternalProjectUtils.cmake:345 (ExternalProject_Add_StepTargets)
  runtimes/CMakeLists.txt:232 (llvm_ExternalProject_Add)
  runtimes/CMakeLists.txt:375 (runtime_default_target)
This warning is for project developers.  Use -Wno-dev to suppress it.
```
I'm guessing we could do something like:
```diff
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 5e786b712051..d21bcd0a2c3a 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -2,6 +2,11 @@
 
 cmake_minimum_required(VERSION 3.13.4)
 
+# CMP0114: ExternalProject has new behavior.
+# 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)
```
but perhaps it's better to fix our cmake to upgrade to the new behavior, if possible?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztVslu4zgQ_Rr7QljQZis--OAkDmDAWZClG3MyKLFks0OJGpLK8vdTRclrd2MGmO3SgGBRZOnV9l7JuRafs2st6w3jLG-lEkyXzG2BRWkQBiHjteiWETOggFuwbBBfLNmWv0E9iDPHHFgH-J4SYPZGg3jKGqNFW-ALnFlngFeE_c5Nje4sK7VhFRAYrVarL7frxd38crVYP77cPS9vF09dQIg0SOaD8HoQzgeTsL_849UtfwX2tUMkJAFv5Jg7fLhprcFfu-UG8F5UaIv3W4xJUXw3iw8HpubqwehvULigs0jmcZRmBFaBtXwDx_4Ze9BKFp_s6vYhjKKUSctq7ZgFhzbsDBGzhoY5bjbgMN9WqU_GhW4cFViaHSRZ2YCxx7ZGt7EPg41GW1DNqDlxh6e-bP2uAMeloldfLBDmDtFDrHurQlcVddFpCtP3tj-hXds2jcFEcR9z6ZsT9NXu4c7T6jLCWDNqkJM1VjNj77pF9ghoAGF17R3tc8egKU2sKjFjB4yvFUgXohFra6LPeb5XyAHXxYZXDtRnBaVjGrcJFbNruJO5VNJ97isq6wKOMz20qU_tiivFnhwvXn2ntXXI3AJqxwo6KaWx7rTxO_5Ue_4QZc9K8-KoHzsiJemY0M9s1nMh1k9YjOeuO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