aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-11 10:48:58 -0700
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-09-30 21:01:38 +0200
commit7e417ac0fa20ce8ddc3018f7c947c352730bc518 (patch)
treec11f7f3021d79cbe257aad969c6eb67c1080e2a3
parent74819dbd2a323d6ab37860a25135d146602eb579 (diff)
downloadmeson-7e417ac0fa20ce8ddc3018f7c947c352730bc518.zip
meson-7e417ac0fa20ce8ddc3018f7c947c352730bc518.tar.gz
meson-7e417ac0fa20ce8ddc3018f7c947c352730bc518.tar.bz2
build: Allow `Dict[OptionKey, str` in parse_overrides
We really want to move all of this option handling into the interpreter through the typed_kwargs, this is the first step to that
-rw-r--r--mesonbuild/build.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 576bb03..e5900ac 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -611,8 +611,15 @@ class Target(HoldableObject):
@staticmethod
def parse_overrides(kwargs: T.Dict[str, T.Any]) -> T.Dict[OptionKey, str]:
+ opts = kwargs.get('override_options', [])
+
+ # In this case we hav ean already parsed and ready to go dictionary
+ # provided by typed_kwargs
+ if isinstance(opts, dict):
+ return T.cast(T.Dict[OptionKey, str], opts)
+
result: T.Dict[OptionKey, str] = {}
- overrides = stringlistify(kwargs.get('override_options', []))
+ overrides = stringlistify(opts)
for o in overrides:
if '=' not in o:
raise InvalidArguments('Overrides must be of form "key=value"')