From 1b2b3efb544354aeca32419c3e9b215176135874 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 4 Feb 2019 10:35:15 +0100 Subject: [PATCH] Allow the platform itself to set on which platform we need to build the dep For some complex build, we may want to build a dependency on another platform that the target platform. --- kiwixbuild/builder.py | 5 +---- kiwixbuild/platforms/base.py | 7 +++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kiwixbuild/builder.py b/kiwixbuild/builder.py index 9df8762..8a5dbba 100644 --- a/kiwixbuild/builder.py +++ b/kiwixbuild/builder.py @@ -76,10 +76,7 @@ class Builder: targetPlatform = PlatformInfo.get_platform(targetPlatformName) for dep in target.get_dependencies(targetPlatform, True): - if isinstance(dep, tuple): - depPlatform, depName = dep - else: - depPlatform, depName = targetPlatformName, dep + depPlatform, depName = targetPlatform.get_fully_qualified_dep(dep) if (depPlatform, depName) in targets: yield from self.order_dependencies((depPlatform, depName), targets) yield ('source', targetName) diff --git a/kiwixbuild/platforms/base.py b/kiwixbuild/platforms/base.py index 4252195..8e7704a 100644 --- a/kiwixbuild/platforms/base.py +++ b/kiwixbuild/platforms/base.py @@ -65,6 +65,13 @@ class PlatformInfo(metaclass=_MetaPlatform): depPlatform.add_targets(depName, targets) return [(self.name, targetName)] + def get_fully_qualified_dep(self, dep): + if isinstance(dep, tuple): + return dep + else: + return self.name, dep + + def get_cross_config(self): return {}