aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-12-06 15:23:03 -0800
committerEli Schwartz <eschwartz93@gmail.com>2022-01-18 17:53:29 -0500
commit23af9e4c1a77072218bc3123bc1151b4845049d5 (patch)
treeb58ba7717fd55599ad9a5407854af866912b4ce5 /mesonbuild/build.py
parent5c979eb21f4e53807a9a837ec1166861dd754227 (diff)
downloadmeson-23af9e4c1a77072218bc3123bc1151b4845049d5.zip
meson-23af9e4c1a77072218bc3123bc1151b4845049d5.tar.gz
meson-23af9e4c1a77072218bc3123bc1151b4845049d5.tar.bz2
build: move configuration_data initial value handling to build.ConfigurationData
It really belongs here, not in the interpreter
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 93bf29d..ad5d226 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -2767,17 +2767,16 @@ class CustomTargetIndex(HoldableObject):
return self.target.get_custom_install_dir()
class ConfigurationData(HoldableObject):
- def __init__(self) -> None:
+ def __init__(self, initial_values: T.Optional[T.Union[
+ T.Dict[str, T.Tuple[T.Union[str, int, bool], T.Optional[str]]],
+ T.Dict[str, T.Union[str, int, bool]]]
+ ] = None):
super().__init__()
- self.values: T.Dict[
- str,
- T.Tuple[
- T.Union[str, int, bool],
- T.Optional[str]
- ]
- ] = {}
+ self.values: T.Dict[str, T.Tuple[T.Union[str, int, bool], T.Optional[str]]] = \
+ {k: v if isinstance(v, tuple) else (v, None) for k, v in initial_values.items()} if initial_values else {}
+ self.used: bool = False
- def __repr__(self):
+ def __repr__(self) -> str:
return repr(self.values)
def __contains__(self, value: str) -> bool: