aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-03-25 14:07:04 -0700
committerXavier Claessens <xclaesse@gmail.com>2021-05-28 09:26:38 -0400
commitf9a9faba92ea214de73624701f21220470257e11 (patch)
tree54f530f287b1cba8c3088d83e4cd9844dae011fb
parent012d60b100ec702dabb6fd58f6a765ec60b1b199 (diff)
downloadmeson-f9a9faba92ea214de73624701f21220470257e11.zip
meson-f9a9faba92ea214de73624701f21220470257e11.tar.gz
meson-f9a9faba92ea214de73624701f21220470257e11.tar.bz2
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.
-rw-r--r--mesonbuild/build.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 633ffea..7d1529a 100644
--- a/mesonbuild/build.py
+++ b/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):