Skip to content

Commit ef8e14e

Browse files
authored
Support -static-stdlib on non-Apple platforms (#24)
* Support `--static-stdlib` on non-Apple platforms Fixes #23. * CI * wip * wip * wip * wip * give up
1 parent d342e05 commit ef8e14e

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@ test-linux:
1616
-v "$(PWD):$(PWD)" \
1717
-w "$(PWD)" \
1818
swift:5.6.2-focal \
19-
bash -c "make test"
19+
bash -c "apt-get update && apt-get install make && make test"
20+
21+
test-linux-static-stdlib:
22+
@docker run \
23+
-v "$(PWD):$(PWD)" \
24+
-w "$(PWD)" \
25+
swift:5.6.2-focal \
26+
bash -c "swift build -c debug -Xswiftc -static-stdlib"
27+
@docker run \
28+
-v "$(PWD):$(PWD)" \
29+
-w "$(PWD)" \
30+
swift:5.6.2-focal \
31+
bash -c "swift build -c release -Xswiftc -static-stdlib"
2032

2133
format:
2234
@swift format \

Package.resolved

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/XCTestDynamicOverlay/XCTFail.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@
6565
dlsym(dlopen(nil, RTLD_LAZY), "_XCTFailureHandler"),
6666
to: XCTFailureHandler.self
6767
)
68-
#else
68+
#elseif canImport(XCTest)
6969
// NB: It seems to be safe to import XCTest on Linux
7070
@_exported import func XCTest.XCTFail
71+
#else
72+
public func XCTFail(_ message: String = "") {}
73+
public func XCTFail(_ message: String = "", file: StaticString, line: UInt) {}
7174
#endif
7275
#else
7376
/// This function generates a failure immediately and unconditionally.

0 commit comments

Comments
 (0)