We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c1ddf5 commit 232c7e2Copy full SHA for 232c7e2
Sources/swiftpm-testing-helper/Entrypoint.swift
@@ -10,15 +10,24 @@
10
//
11
//===----------------------------------------------------------------------===//
12
13
+#if canImport(Darwin)
14
import Darwin.C
15
+#elseif canImport(Android)
16
+import Android
17
+#endif
18
19
@main
20
struct Entrypoint {
21
static func main() throws {
22
let args = CommandLine.arguments
23
if args.count >= 3, args[1] == "--test-bundle-path" {
24
let bundlePath = args[2]
- guard let image = dlopen(bundlePath, RTLD_LAZY | RTLD_FIRST) else {
25
+ #if canImport(Darwin)
26
+ let flags = RTLD_LAZY | RTLD_FIRST
27
+ #else
28
+ let flags = RTLD_LAZY
29
+ #endif
30
+ guard let image = dlopen(bundlePath, flags) else {
31
let errorMessage: String = dlerror().flatMap {
32
String(validatingCString: $0)
33
} ?? "An unknown error occurred."
0 commit comments