File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Sources/swiftpm-testing-helper Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
+ #if canImport(Darwin)
13
14
import Darwin. C
15
+ #elseif canImport(Android)
16
+ import Android
17
+ #endif
14
18
15
19
@main
16
20
struct Entrypoint {
17
21
static func main( ) throws {
18
22
let args = CommandLine . arguments
19
23
if args. count >= 3 , args [ 1 ] == " --test-bundle-path " {
20
24
let bundlePath = args [ 2 ]
21
- 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 {
22
31
let errorMessage : String = dlerror ( ) . flatMap {
23
32
String ( validatingCString: $0)
24
33
} ?? " An unknown error occurred. "
You can’t perform that action at this time.
0 commit comments