CMake 3.11 emits "Deprecation Warning at CMakeLists.txt:20" when configuring the project
- Dominant language
- LLVM
- Stars
- 19
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
When using CMake 3.11, the `cmake` command emits a deprecation warning.
## Steps to reproduce
* Ensure that you have CMake 3.11 installed in your system.
* Run the following commands:
```
git clone https://github.com/avast-tl/llvm.git
mkdir -p llvm/build && cd llvm/build
cmake ..
```
## Output
```
-- No build type selected, default to Debug
CMake Deprecation Warning at CMakeLists.txt:20 (cmake_policy):
The OLD behavior for policy CMP0051 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.
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
...
```
## Expected output
The same as when using CMake 3.10:
```
-- No build type selected, default to Debug
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
...
```
We should fix the build system so no warning is emitted as it only clutters the output.
Contributor guide
Research direction
Start at CMakeLists.txt:20 and reproduce the warning by running cmake .. from the llvm/build directory with CMake 3.11. Compare the configuration output with CMake 3.10; done means the CMP0051 deprecation warning is no longer emitted while the normal compiler identification output remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 56/100