in Sources/Build/LLBuildManifestBuilder.swift [541:574]
func addStaticTargetInputs(_ target: ResolvedTarget) throws {
// Ignore C Modules.
if target.underlyingTarget is SystemLibraryTarget { return }
// Ignore Binary Modules.
if target.underlyingTarget is BinaryTarget { return }
// Ignore Plugin Targets.
if target.underlyingTarget is PluginTarget { return }
// Depend on the binary for executable targets.
if target.type == .executable {
// FIXME: Optimize.
let _product = plan.graph.allProducts.first {
$0.type == .executable && $0.executableModule == target
}
if let product = _product {
guard let planProduct = plan.productMap[product] else {
throw InternalError("unknown product \(product)")
}
inputs.append(file: planProduct.binary)
}
return
}
switch plan.targetMap[target] {
case .swift(let target)?:
inputs.append(file: target.moduleOutputPath)
case .clang(let target)?:
for object in target.objects {
inputs.append(file: object)
}
case nil:
throw InternalError("unexpected: target \(target) not in target map \(plan.targetMap)")
}
}