-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathPackage.swift
42 lines (39 loc) · 1.44 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// swift-tools-version:5.6
import PackageDescription
#if canImport(JavaScriptCore)
let targets: [Target] = [
.target(name: "JXKit", resources: [.process("Resources")])
]
#elseif os(Windows)
// Windows iTunes installs JSC at: C:/Program Files/iTunes/JavaScriptCore.dll
// See also: https://pub.dev/packages/flutter_jscore#windows
let targets: [Target] = [
.target(name: "JXKit",
linkerSettings: [
.linkedLibrary("Kernel32", .when(platforms: [.windows])),
.linkedLibrary("JavaScriptCore", .when(platforms: [.windows])),
.linkedLibrary("CoreFoundation", .when(platforms: [.windows])),
.linkedLibrary("WTF", .when(platforms: [.windows])),
.linkedLibrary("ASL", .when(platforms: [.windows])),
])
]
#else // No native JavaScriptCore falls back to javascriptcoregtk
let targets: [Target] = [
.systemLibrary(name: "CJSCore",
pkgConfig: "javascriptcoregtk-4.0",
providers: [.apt(["libjavascriptcoregtk-4.0-dev"]), .yum(["webkit2gtk"])]),
.target(name: "JXKit", dependencies: ["CJSCore"], resources: [.process("Resources")])
]
#endif
let package = Package(
name: "JXKit",
platforms: [ .macOS(.v10_15), .iOS(.v13), .tvOS(.v13) ],
products: [
.library(name: "JXKit", targets: ["JXKit"]),
],
dependencies: [
],
targets: targets + [
.testTarget(name: "JXKitTests", dependencies: ["JXKit"], resources: [.copy("jsmodules")])
]
)