Compare commits

...

3 Commits

Author SHA1 Message Date
Bartosz Polaczyk 64472d58bf Merge pull request #225 from polac24/fix-spaces-libtool
Support spaces in libtools paths
2023-08-17 08:54:47 +02:00
Bartosz Polaczyk 3d96dddc91 Fix linting 2023-08-16 14:23:13 +02:00
Bartosz Polaczyk deb6adcb70 Support spaces in libtools paths 2023-08-16 13:13:14 +02:00
2 changed files with 13 additions and 1 deletions
@@ -47,7 +47,8 @@ public class XCLibtoolHelper {
case "-dependency_info":
dependencyInfo = args[i + 1]
i += 1
case let input where args[i].starts(with: "/") && ["", "a"].contains(URL(string: args[i])?.pathExtension):
case let input where input.starts(with: "/") &&
["", "a"].contains(URL(fileURLWithPath: input).pathExtension):
// Assume always absolute paths to the library
// Support for static frameworks (no extension) and static libraries (.a)
inputLibraries.append(input)
@@ -74,4 +74,15 @@ class XCLibtoolHelperTests: XCTestCase {
inputs: ["/arch1/static", "/arch2/static"]
))
}
func testRecognizesPathsWithSpaces() throws {
let mode = try XCLibtoolHelper.buildMode(
args: ["-static", "-o", "/universal/static", "/arch/with space/static"]
)
XCTAssertEqual(mode, .createUniversalBinary(
output: "/universal/static",
inputs: ["/arch/with space/static"]
))
}
}