From 11fe8f11579d46870ed340dca8234ea35edf769c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Thu, 24 Nov 2022 13:19:59 +0100 Subject: [PATCH] Ignore unused compiler options for "meson configure" "meson setup" ignores unused compiler options, like "cpp_args" on a project without C++. "meson configure" doesn't have the filtering from "set_default_options", so it fails with : ERROR: Unknown options: "cpp_args" So now unused compiler options (ie not in coredata.options) are no longer marked unknown. Fixes: #11060 --- mesonbuild/coredata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index cdbf3c046..e94c02abc 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -821,7 +821,7 @@ class CoreData: continue elif k in self.options: self.set_option(k, v) - elif k.machine != MachineChoice.BUILD: + elif k.machine != MachineChoice.BUILD and k.type != OptionType.COMPILER: unknown_options.append(k) if unknown_options: unknown_options_str = ', '.join(sorted(str(s) for s in unknown_options))