Skip to content

Commit 64472d5

Browse files
authored
Merge pull request #225 from polac24/fix-spaces-libtool
Support spaces in libtools paths
2 parents f8c854d + 3d96ddd commit 64472d5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Sources/xclibtoolSupport/XCLibtoolHelper.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public class XCLibtoolHelper {
4747
case "-dependency_info":
4848
dependencyInfo = args[i + 1]
4949
i += 1
50-
case let input where args[i].starts(with: "/") && ["", "a"].contains(URL(string: args[i])?.pathExtension):
50+
case let input where input.starts(with: "/") &&
51+
["", "a"].contains(URL(fileURLWithPath: input).pathExtension):
5152
// Assume always absolute paths to the library
5253
// Support for static frameworks (no extension) and static libraries (.a)
5354
inputLibraries.append(input)

Tests/xclibtoolSupportTests/XCLibtoolHelperTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,15 @@ class XCLibtoolHelperTests: XCTestCase {
7474
inputs: ["/arch1/static", "/arch2/static"]
7575
))
7676
}
77+
78+
func testRecognizesPathsWithSpaces() throws {
79+
let mode = try XCLibtoolHelper.buildMode(
80+
args: ["-static", "-o", "/universal/static", "/arch/with space/static"]
81+
)
82+
83+
XCTAssertEqual(mode, .createUniversalBinary(
84+
output: "/universal/static",
85+
inputs: ["/arch/with space/static"]
86+
))
87+
}
7788
}

0 commit comments

Comments
 (0)