Make the platform responsible to add the targets.

This commit is contained in:
Matthieu Gautier
2018-05-30 11:33:36 +02:00
parent c8c0192675
commit 3eae47240b
2 changed files with 20 additions and 20 deletions

View File

@ -56,6 +56,20 @@ class PlatformInfo(metaclass=_MetaPlatform):
plt_name = 'neutral' if ToolchainClass.neutral else self.name
targets[(plt_name, tlc_name)] = ToolchainClass.Builder
def add_targets(self, targetName, targets):
if (self.name, targetName) in targets:
return
targetClass = Dependency.all_deps[targetName]
targets[('source', targetName)] = targetClass.Source
targets[(self.name, targetName)] = targetClass.Builder
for dep in targetClass.Builder.get_dependencies(self):
try:
depPlatformName, depName = dep
except ValueError:
depPlatformName, depName = self.name, dep
depPlatform = self.get_platform(depPlatformName, targets)
depPlatform.add_targets(depName, targets)
def get_cross_config(self):
return {}