diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-12-04 17:01:45 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-01-04 12:20:58 -0800 |
commit | e81acbd6069e8c1ae8e3be7bb83ddc239009d42d (patch) | |
tree | b08545b2844650ed95e42ade00ecb1cd3fb85b88 /mesonbuild/dependencies/base.py | |
parent | 71db6b04a31707674ad776be1cf22f667056d56b (diff) | |
download | meson-e81acbd6069e8c1ae8e3be7bb83ddc239009d42d.zip meson-e81acbd6069e8c1ae8e3be7bb83ddc239009d42d.tar.gz meson-e81acbd6069e8c1ae8e3be7bb83ddc239009d42d.tar.bz2 |
Use a single coredata dictionary for options
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r-- | mesonbuild/dependencies/base.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 7b8045d..e359219 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -658,7 +658,7 @@ class PkgConfigDependency(ExternalDependency): @staticmethod def setup_env(env: T.MutableMapping[str, str], environment: 'Environment', for_machine: MachineChoice, extra_path: T.Optional[str] = None) -> None: - extra_paths: T.List[str] = environment.coredata.builtins[OptionKey('pkg_config_path', machine=for_machine)].value + extra_paths: T.List[str] = environment.coredata.options[OptionKey('pkg_config_path', machine=for_machine)].value if extra_path: extra_paths.append(extra_path) sysroot = environment.properties[for_machine].get_sys_root() @@ -1485,12 +1485,12 @@ class CMakeDependency(ExternalDependency): cfgs = [x for x in tgt.properties['IMPORTED_CONFIGURATIONS'] if x] cfg = cfgs[0] - if OptionKey('b_vscrt') in self.env.coredata.base_options: - is_debug = self.env.coredata.get_builtin_option('buildtype') == 'debug' - if self.env.coredata.base_options[OptionKey('b_vscrt')].value in {'mdd', 'mtd'}: + if OptionKey('b_vscrt') in self.env.coredata.options: + is_debug = self.env.coredata.get_option(OptionKey('buildtype')) == 'debug' + if self.env.coredata.options[OptionKey('b_vscrt')].value in {'mdd', 'mtd'}: is_debug = True else: - is_debug = self.env.coredata.get_builtin_option('debug') + is_debug = self.env.coredata.get_option(OptionKey('debug')) if is_debug: if 'DEBUG' in cfgs: cfg = 'DEBUG' |