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.
This commit is contained in:
Matthieu Gautier 2019-02-04 10:35:15 +01:00
parent ef4cf7ada7
commit 1b2b3efb54
2 changed files with 8 additions and 4 deletions

View File

@ -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)

View File

@ -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 {}