diff options
| author | Benjamin Gilbert <bgilbert@backtick.net> | 2025-04-19 00:21:46 -0500 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-04-20 13:56:51 +0300 |
| commit | 7889cac7d5c976a8f11c47bfcb8978ac27b15a61 (patch) | |
| tree | 892788ae3eea3d6be43717f09153756c139c24fd | |
| parent | 95895492f5b25824d80471ab7a850e9cde52bab8 (diff) | |
| download | meson-7889cac7d5c976a8f11c47bfcb8978ac27b15a61.tar.gz | |
Log non-fatally if CMake doesn't find a package
If CMake fails to find a package, we should log it in meson-log.txt, but
shouldn't bother the user unless there are details to report. In
addition, we were calling mlog.warning() without fatal=False, so if msetup
was called with --fatal-meson-warnings we'd fail the entire setup in this
case, even for optional dependencies. Log a notice with fatal=False if
CMake reported an error, and a debug message otherwise.
Notably, the "even though Meson's preliminary check succeeded" case can
occur when a dependency is missing but its Find*.cmake is shipped with
CMake itself.
Fixes: 92c517ea69 ("output PACKAGE_NOT_FOUND_MESSAGE as warning when CMake package is not found")
| -rw-r--r-- | mesonbuild/dependencies/cmake.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/cmake.py b/mesonbuild/dependencies/cmake.py index 0c350214b..4e449816d 100644 --- a/mesonbuild/dependencies/cmake.py +++ b/mesonbuild/dependencies/cmake.py @@ -416,11 +416,11 @@ class CMakeDependency(ExternalDependency): if not self.is_found: not_found_message = self.traceparser.get_cmake_var('PACKAGE_NOT_FOUND_MESSAGE') if len(not_found_message) > 0: - mlog.warning( + mlog.notice( 'CMake reported that the package {} was not found with the following reason:\n' - '{}'.format(name, not_found_message[0])) + '{}'.format(name, not_found_message[0]), fatal=False) else: - mlog.warning( + mlog.debug( 'CMake reported that the package {} was not found, ' 'even though Meson\'s preliminary check succeeded.'.format(name)) raise self._gen_exception('PACKAGE_FOUND is false') |
