diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-05-02 15:40:21 +0200 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-05-06 13:21:24 -0700 |
| commit | 42d531da65f7d51803ad05dcdd18a650827a062c (patch) | |
| tree | d845125e0e9ead6ee0d375df2b32fd9bd53d2567 /mesonbuild/interpreter/interpreter.py | |
| parent | bc825b805daf7f48cade7bc8d6defd6e2fa75b87 (diff) | |
| download | meson-42d531da65f7d51803ad05dcdd18a650827a062c.tar.gz | |
interpreter: allow passing default default_options to do_subproject
Apply the default_library=... default after the default options have been
converted to a dictionary, to avoid having to deal with all the possible types
of the default_options keyword argument.
Fixes: #14532
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
| -rw-r--r-- | mesonbuild/interpreter/interpreter.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 27e682edb..8fb660d1f 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -867,7 +867,8 @@ class Interpreter(InterpreterBase, HoldableObject): self.subprojects[subp_name] = sub return sub - def do_subproject(self, subp_name: str, kwargs: kwtypes.DoSubproject, force_method: T.Optional[wrap.Method] = None) -> SubprojectHolder: + def do_subproject(self, subp_name: str, kwargs: kwtypes.DoSubproject, force_method: T.Optional[wrap.Method] = None, + extra_default_options: T.Optional[T.Dict[str, options.ElementaryOptionValues]] = None) -> SubprojectHolder: if subp_name == 'sub_static': pass disabled, required, feature = extract_required_kwarg(kwargs, self.subproject) @@ -881,6 +882,8 @@ class Interpreter(InterpreterBase, HoldableObject): default_options = [default_options] if isinstance(default_options, list): default_options = dict((x.split('=', 1) for x in default_options)) + if extra_default_options: + default_options = {**extra_default_options, **default_options} if subp_name == '': raise InterpreterException('Subproject name must not be empty.') |
