cmake: Deprecate CMake <3.14 and warn for <3.17 (#9677)

* cmake: Deprecate CMake <3.14 and warn for <3.17

See:

- #7832
- #9676

* cmake: Add deprecation release note snippet
pull/9685/head
Daniel Mensinger 3 years ago committed by GitHub
parent 45c5300496
commit 3f1519f2e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      docs/markdown/snippets/cmake_deprecated.md
  2. 14
      mesonbuild/cmake/interpreter.py

@ -0,0 +1,7 @@
## Support for CMake <3.14 is now deprecated for CMake subprojects
In CMake 3.14, the File API was introduced and the old CMake server API was
deprecated (and removed in CMake 3.20). Thus support for this API will also
be removed from Meson in future releases.
This deprecation only affects CMake subprojects.

@ -33,6 +33,7 @@ from functools import lru_cache
from pathlib import Path
import typing as T
import re
import textwrap
from os import environ
from ..mparser import (
@ -832,6 +833,19 @@ class CMakeInterpreter:
if version_compare(cmake_exe.version(), '>=3.14'):
self.cmake_api = CMakeAPI.FILE
self.fileapi.setup_request()
else:
mlog.deprecation(f'Support for CMake <3.14 (Meson found {cmake_exe.version()}) is deprecated since Meson 0.61.0')
if version_compare(cmake_exe.version(), '<3.17.0'):
mlog.warning(textwrap.dedent(f'''\
The minimum recommended CMake version is 3.17.0.
|
| However, Meson was only able to find CMake {cmake_exe.version()} at {cmake_exe.cmakebin.command}.
|
| Support for all CMake versions below 3.17.0 will be deprecated and
| removed once newer CMake versions are more widely adopted. If you encounter
| any errors please try upgrading CMake to a newer version first.
'''))
# Run CMake
mlog.log()

Loading…
Cancel
Save