aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-03-25 14:18:58 -0700
committerXavier Claessens <xclaesse@gmail.com>2021-05-28 09:26:38 -0400
commit76b98459accdbe8a12eb7c41cfac3fc907a62057 (patch)
treefdfa186b07b516e7992f641436e9dcc19d269261 /mesonbuild
parentf9a9faba92ea214de73624701f21220470257e11 (diff)
downloadmeson-76b98459accdbe8a12eb7c41cfac3fc907a62057.zip
meson-76b98459accdbe8a12eb7c41cfac3fc907a62057.tar.gz
meson-76b98459accdbe8a12eb7c41cfac3fc907a62057.tar.bz2
coredata: Use a PerMachineDefaultable for the deps cache
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/coredata.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 49b84b9..7f94d18 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -20,8 +20,8 @@ from pathlib import PurePath
from collections import OrderedDict
from .mesonlib import (
MesonException, EnvironmentException, MachineChoice, PerMachine,
- default_libdir, default_libexecdir, default_prefix, split_args,
- OptionKey, OptionType,
+ PerMachineDefaultable, default_libdir, default_libexecdir,
+ default_prefix, split_args, OptionKey, OptionType,
)
from .wrap import WrapMode
import ast
@@ -406,9 +406,13 @@ class CoreData:
# want to overwrite options for such subprojects.
self.initialized_subprojects: T.Set[str] = set()
- build_cache = DependencyCache(self.options, MachineChoice.BUILD)
- host_cache = DependencyCache(self.options, MachineChoice.HOST)
- self.deps = PerMachine(build_cache, host_cache) # type: PerMachine[DependencyCache]
+ # For host == build configuraitons these caches should be the same.
+ deps: PerMachineDefaultable[DependencyCache] = PerMachineDefaultable(
+ DependencyCache(self.options, MachineChoice.BUILD))
+ if self.is_cross_build():
+ deps.host = DependencyCache(self.options, MachineChoice.HOST)
+ self.deps = deps.default_missing()
+
self.compiler_check_cache = OrderedDict() # type: T.Dict[CompilerCheckCacheKey, compiler.CompileResult]
# Only to print a warning if it changes between Meson invocations.