diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-05-15 14:02:14 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-05-20 10:05:36 -0700 |
commit | 146e97e974fe02f93e3fb20d2a1cb850255f69fc (patch) | |
tree | 56e61ddd71b9ad9a6c5b04247ca806bd2647cec5 /mesonbuild/interpreter.py | |
parent | 5df6823bd8abb3ea920c81259a38f55cfd5fa568 (diff) | |
download | meson-146e97e974fe02f93e3fb20d2a1cb850255f69fc.zip meson-146e97e974fe02f93e3fb20d2a1cb850255f69fc.tar.gz meson-146e97e974fe02f93e3fb20d2a1cb850255f69fc.tar.bz2 |
Use dependency cache
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 4a91b68..9efe5cd 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2860,14 +2860,13 @@ external dependencies (including libraries) must go to "dependencies".''') # FIXME: Not all dependencies support such a distinction right now, # and we repeat this check inside dependencies that do. We need to # consolidate this somehow. - is_cross = self.environment.is_cross_build() - if 'native' in kwargs and is_cross: - want_cross = not kwargs['native'] + if self.environment.is_cross_build() and kwargs.get('native', False): + for_machine = MachineChoice.BUILD else: - want_cross = is_cross + for_machine = MachineChoice.HOST - identifier = dependencies.get_dep_identifier(name, kwargs, want_cross) - cached_dep = self.coredata.deps.get(identifier) + identifier = dependencies.get_dep_identifier(name, kwargs) + cached_dep = self.coredata.deps[for_machine].get(identifier) if cached_dep: if not cached_dep.found(): mlog.log('Dependency', mlog.bold(name), @@ -3019,7 +3018,11 @@ external dependencies (including libraries) must go to "dependencies".''') # cannot cache them. They must always be evaluated else # we won't actually read all the build files. if dep.found(): - self.coredata.deps[identifier] = dep + if self.environment.is_cross_build() and kwargs.get('native', False): + for_machine = MachineChoice.BUILD + else: + for_machine = MachineChoice.HOST + self.coredata.deps[for_machine].put(identifier, dep) return DependencyHolder(dep, self.subproject) if has_fallback: |