diff options
Diffstat (limited to 'mesonbuild/dependencies')
-rw-r--r-- | mesonbuild/dependencies/base.py | 11 | ||||
-rw-r--r-- | mesonbuild/dependencies/boost.py | 4 | ||||
-rw-r--r-- | mesonbuild/dependencies/ui.py | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 6f568d3..7b8045d 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -37,7 +37,7 @@ from ..environment import Environment, MachineInfo from ..cmake import CMakeExecutor, CMakeTraceParser, CMakeException, CMakeToolchain, CMakeExecScope, check_cmake_args from ..mesonlib import MachineChoice, MesonException, OrderedSet, PerMachine from ..mesonlib import Popen_safe, version_compare_many, version_compare, listify, stringlistify, extract_as_list, split_args -from ..mesonlib import Version, LibType +from ..mesonlib import Version, LibType, OptionKey from ..mesondata import mesondata if T.TYPE_CHECKING: @@ -656,8 +656,9 @@ class PkgConfigDependency(ExternalDependency): return rc, out, err @staticmethod - def setup_env(env, environment, for_machine, extra_path=None): - extra_paths = environment.coredata.builtins_per_machine[for_machine]['pkg_config_path'].value + 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 if extra_path: extra_paths.append(extra_path) sysroot = environment.properties[for_machine].get_sys_root() @@ -1484,9 +1485,9 @@ class CMakeDependency(ExternalDependency): cfgs = [x for x in tgt.properties['IMPORTED_CONFIGURATIONS'] if x] cfg = cfgs[0] - if 'b_vscrt' in self.env.coredata.base_options: + 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['b_vscrt'].value in ('mdd', 'mtd'): + if self.env.coredata.base_options[OptionKey('b_vscrt')].value in {'mdd', 'mtd'}: is_debug = True else: is_debug = self.env.coredata.get_builtin_option('debug') diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py index 370fa72..e2e4789 100644 --- a/mesonbuild/dependencies/boost.py +++ b/mesonbuild/dependencies/boost.py @@ -616,8 +616,8 @@ class BoostDependency(ExternalDependency): # MSVC is very picky with the library tags vscrt = '' try: - crt_val = self.env.coredata.base_options['b_vscrt'].value - buildtype = self.env.coredata.builtins['buildtype'].value + crt_val = self.env.coredata.base_options[mesonlib.OptionKey('b_vscrt')].value + buildtype = self.env.coredata.builtins[mesonlib.OptionKey('buildtype')].value vscrt = self.clib_compiler.get_crt_compile_args(crt_val, buildtype)[0] except (KeyError, IndexError, AttributeError): pass diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index baf8e94..942f69a 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -383,8 +383,8 @@ class QtBaseDependency(ExternalDependency): # Use the buildtype by default, but look at the b_vscrt option if the # compiler supports it. is_debug = self.env.coredata.get_builtin_option('buildtype') == 'debug' - if 'b_vscrt' in self.env.coredata.base_options: - if self.env.coredata.base_options['b_vscrt'].value in ('mdd', 'mtd'): + if mesonlib.OptionKey('b_vscrt') in self.env.coredata.base_options: + if self.env.coredata.base_options[mesonlib.OptionKey('b_vscrt')].value in {'mdd', 'mtd'}: is_debug = True modules_lib_suffix = self._get_modules_lib_suffix(is_debug) |