Skip to content

Commit 4f2e192

Browse files
authored
Merge pull request #201 from SwiftJava/minor-android-changes
Facilitate implicit import of Dispatch in Foundation
2 parents 2e96829 + deb34d1 commit 4f2e192

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Sources/XCTest/Private/PrintObserver.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ internal class PrintObserver: XCTestObservation {
5959

6060
fileprivate func printAndFlush(_ message: String) {
6161
print(message)
62+
#if !os(Android)
6263
fflush(stdout)
64+
#endif
6365
}
6466

6567
private func formatTimeInterval(_ timeInterval: TimeInterval) -> String {

build_script.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,14 @@ def build(args):
200200
libdispatch_args=libdispatch_args,
201201
source_paths=" ".join(sourcePaths)))
202202
run("{swiftc} -emit-library {build_dir}/XCTest.o "
203-
"-L {foundation_build_dir} -lswiftGlibc -lswiftCore -lFoundation -lm "
203+
"-L {dispatch_build_dir} -L {foundation_build_dir} -lswiftGlibc -lswiftCore -lFoundation -lm "
204204
# We embed an rpath of `$ORIGIN` to ensure other referenced
205205
# libraries (like `Foundation`) can be found solely via XCTest.
206206
"-Xlinker -rpath=\\$ORIGIN "
207207
"-o {build_dir}/libXCTest.so".format(
208208
swiftc=swiftc,
209209
build_dir=build_dir,
210+
dispatch_build_dir=os.path.join(args.libdispatch_build_dir, 'src', '.libs'),
210211
foundation_build_dir=foundation_build_dir))
211212

212213
# Build the static library.

0 commit comments

Comments
 (0)