From f44541e1c74bcddcb6cf0dafdefe63f00048859f Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 10 Apr 2024 10:33:59 -0700 Subject: [PATCH] dependencies/dev: make the warning about LLVM's CMake non-fatal This isn't case where fatal is appropriate, as the end user has no control over this, and it may not be hit in all configurations of a project. --- mesonbuild/dependencies/dev.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index 89761f24f..de85516fe 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -413,16 +413,17 @@ class LLVMDependencyCMake(CMakeDependency): mlog.warning( 'The LLVM dependency was not found via CMake, as this method requires', 'both a C and C++ compiler to be enabled, but', - 'only' if langs else 'neither', + 'only' if len(langs) == 1 else 'neither', 'a', - " nor ".join(l.upper() for l in langs), + " nor ".join(l.upper() for l in langs).replace('CPP', 'C++'), 'compiler is enabled for the', f"{self.for_machine}.", - "Consider adding {0} to your project() call or using add_languages({0}, native : {1})".format( + 'Consider adding "{0}" to your project() call or using add_languages({0}, native : {1})'.format( ', '.join(f"'{l}'" for l in langs), 'true' if self.for_machine is mesonlib.MachineChoice.BUILD else 'false', ), - 'before the LLVM dependency lookup.' + 'before the LLVM dependency lookup.', + fatal=False, ) return