Commit 7584497c authored by Drew's avatar Drew

Support for header files

parent a8ac7c97
......@@ -128,8 +128,9 @@ func process(tasks: [Task], testTask: Task?, package: Package, xcodeprojGUID: St
type = PbxProductReference.ReferenceType.Executable
}
let product = PbxProductReference(name: taskname, type:type)
let sourceRefs = sources.map() {PbxSourceFileReference(path:$0.description)}
//headers are "sources" from atbuild POV but are "other files" from xcode POV
let sourceRefs = sources.filter{!$0.hasSuffix(".h")}.map() {PbxSourceFileReference(path:$0.description)}
let headerRefs = sources.filter{$0.hasSuffix(".h")}.map(){PbxHeaderFileReference(path: $0.description)}
var ldFlags: [String]? = nil
if let flags = task["link-options"]?.vector {
ldFlags = []
......@@ -153,7 +154,7 @@ func process(tasks: [Task], testTask: Task?, package: Package, xcodeprojGUID: St
bridgingHeader = nil
}
let target = PbxNativeTarget(productReference: product, outputType: outputType, sourceFiles: sourceRefs, linkFiles: linkWith, otherFiles: [], bridgingHeader: bridgingHeader, headerSearchPaths: headerSearchPaths, otherLdFlags: ldFlags, appTarget: nil, xcodeprojGUID: xcodeprojGUID )
let target = PbxNativeTarget(productReference: product, outputType: outputType, sourceFiles: sourceRefs, linkFiles: linkWith, otherFiles: headerRefs, bridgingHeader: bridgingHeader, headerSearchPaths: headerSearchPaths, otherLdFlags: ldFlags, appTarget: nil, xcodeprojGUID: xcodeprojGUID )
objects.append(target)
objects.append(product)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment