Issue |
63286
|
Summary |
CMake policy CMP0091 should be upgraded to new form
|
Labels |
cmake,
platform:windows
|
Assignees |
|
Reporter |
mstorsjo
|
CC @zmodem @rnk @glandium
After upgrading the minimum CMake version to 3.20, the CMake policy CMP0091 https://cmake.org/cmake/help/latest/policy/CMP0091.html changed to the new form, which broke a couple build scenarios, as mentioned in #62719. It also broke the LLVM custom parameters for setting what CRT to link against, as described in #32739.
This was temporarily remedied by switching the policy CMP0091 back to the old form in 7d47dac5f828efd1d378ba44a97559114f00fb64 / https://reviews.llvm.org/D150688 (and after a revert, when relanded in cbaa3597aaf6273e66b3f445ed36a6458143fe6a).
Switching the policy to old form is a temporary workaround, as newer CMake warns:
```
CMake Deprecation Warning at /home/martin/code/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
The OLD behavior for policy CMP0091 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
```
In order to switch to the new policy, the root cause of the issues in #62719 need to be fixed; compiler-rt has some custom code for selecting CRT, which doesn't work in the new mode. A pointer to this is https://github.com/llvm/llvm-project/blob/llvmorg-16.0.3/compiler-rt/CMakeLists.txt#L398. Also, the LLVM custom options for choosing the CRT to link, in https://github.com/llvm/llvm-project/blob/llvmorg-16.0.3/llvm/cmake/modules/ChooseMSVCCRT.cmake, need to be updated to use the new CMake mechanisms for selecting CRT, instead of meddling directly in the `CMAKE_${lang}_FLAGS_${build}` variables.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs