Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Sources/SWBBuildService/BuildDependencyInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,18 @@ extension BuildDependencyInfo {

let filename = resolvedBuildFile.absolutePath.basename

// TODO: all of the below are using linkType: .searchPath, we aren't reporting .absolutePath

if resolvedBuildFile.fileType.conformsTo(identifier: "wrapper.framework") {
// TODO: static frameworks?
await inputs.addInput(TargetDependencyInfo.Input(inputType: .framework, name: .name(filename), linkType: .searchPath, libraryType: .dynamic))
}
else if resolvedBuildFile.fileType.conformsTo(identifier: "compiled.mach-o.dylib") {
await inputs.addInput(TargetDependencyInfo.Input(inputType: .library, name: .name(filename), linkType: .searchPath, libraryType: .dynamic))
}
else if resolvedBuildFile.fileType.conformsTo(identifier: "sourcecode.text-based-dylib-definition") {
await inputs.addInput(TargetDependencyInfo.Input(inputType: .library, name: .name(filename), linkType: .searchPath, libraryType: .dynamic))
}
else if resolvedBuildFile.fileType.conformsTo(identifier: "archive.ar") {
await inputs.addInput(TargetDependencyInfo.Input(inputType: .library, name: .name(filename), linkType: .searchPath, libraryType: .static))
}
Expand Down
2 changes: 2 additions & 0 deletions Sources/SWBTestSupport/TestWorkspaces.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ package final class TestFile: TestInternalStructureItem, CustomStringConvertible
return "text.json.xcstrings"
case ".swift":
return "sourcecode.swift"
case ".tbd":
return "sourcecode.text-based-dylib-definition"
case ".tif", ".tiff":
return "image.tiff"
case ".txt":
Expand Down
8 changes: 8 additions & 0 deletions Tests/SWBBuildServiceTests/BuildDependencyInfoTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import Foundation
TestFile("libFoo.dylib"),
TestFile("libBar.a"),
TestFile("libBaz.a"),
TestFile("libQux.tbd"),
]),
buildConfigurations: [
TestBuildConfiguration(
Expand Down Expand Up @@ -124,6 +125,7 @@ import Foundation
TestFrameworksBuildPhase([
"Foundation.framework",
"libBar.a",
"libQux.tbd",
])
]
),
Expand Down Expand Up @@ -221,6 +223,10 @@ import Foundation
#expect(input.inputType == .library)
#expect(input.linkType == .searchPath)
}
results.checkTargetInputName(target, .name("libQux.tbd")) { input in
#expect(input.inputType == .library)
#expect(input.linkType == .searchPath)
}
results.checkNoMoreTargetInputs(target)

results.checkTargetOutputPath(target, "/usr/local/lib/libDylibTarget.dylib")
Expand Down Expand Up @@ -325,6 +331,8 @@ import Foundation

"-Xlinker -reexport-lXlinkerLib",
"-Wl,-reexport-lQuoteLib",

// TODO: we should support positional arguments as well but that requires a complete understanding of all possible linker args, will come back to this
].joined(separator: " ")
]),
],
Expand Down