build: Use a PerMachineDefaultable for dependency override cache

This way if we're doing a host == build configuration then the build and
host dependencies will be stored correctly.
pull/8809/head
Dylan Baker 4 years ago committed by Xavier Claessens
parent 012d60b100
commit f9a9faba92
  1. 10
      mesonbuild/build.py

@ -30,7 +30,7 @@ from .mesonlib import (
File, MesonException, MachineChoice, PerMachine, OrderedSet, listify,
extract_as_list, typeslistify, stringlistify, classify_unity_sources,
get_filenames_templates_dict, substitute_values, has_path_sep, unholder,
OptionKey
OptionKey, PerMachineDefaultable,
)
from .compilers import (
Compiler, is_object, clink_langs, sort_clink, lang_suffixes,
@ -229,7 +229,13 @@ class Build:
self.test_setup_default_name = None
self.find_overrides = {}
self.searched_programs = set() # The list of all programs that have been searched for.
self.dependency_overrides = PerMachine({}, {})
# If we are doing a cross build we need two caches, if we're doing a
# build == host compilation the both caches should point to the same place.
dependency_overrides: PerMachineDefaultable[T.Dict[T.Tuple, DependencyOverride]] = PerMachineDefaultable({})
if environment.is_cross_build():
dependency_overrides.host = {}
self.dependency_overrides = dependency_overrides.default_missing()
self.devenv: T.List[EnvironmentVariables] = []
def get_build_targets(self):

Loading…
Cancel
Save