-
Notifications
You must be signed in to change notification settings - Fork 1
/
Package.swift
93 lines (89 loc) · 2.67 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// swift-tools-version:5.4
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
var dependencies: [Package.Dependency] = [
.package(
name: "C_mujoco", url: "https://github.com/liuliu/mujoco.git",
.revision("7723882b073b2fa009a20a899883d785318d465e")),
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.0"),
]
#if swift(>=5.6)
dependencies.append(.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"))
#endif
let package = Package(
name: "MuJoCo",
platforms: [.macOS(.v10_14), .iOS(.v11), .watchOS(.v3), .tvOS(.v10)],
products: [
.library(name: "MuJoCo", type: .static, targets: ["MuJoCo"]),
.executable(name: "simulate", targets: ["simulate"]),
.executable(name: "codegen", targets: ["codegen"]),
],
dependencies: dependencies,
targets: [
.systemLibrary(
name: "C_glfw",
pkgConfig: "glfw3",
providers: [.brew(["glfw"]), .apt(["libglfw3-dev"])]
),
.target(
name: "CShim_mujoco",
dependencies: ["C_mujoco"],
path: "Sources/CShim",
sources: [
"CShim.c"
],
publicHeadersPath: "."),
.target(
name: "MuJoCo",
dependencies: [
"CShim_mujoco", "C_mujoco",
.target(name: "C_glfw", condition: .when(platforms: [.macOS, .linux])),
],
path: "Sources",
exclude: ["CShim", "C_glfw", "codegen", "BUILD.bazel"]),
.executableTarget(
name: "simulate",
dependencies: ["MuJoCo", .product(name: "Numerics", package: "swift-numerics")],
path: "Examples/simulate",
sources: [
"main.swift"
]),
.target(
name: "ChangeCases",
path: "Sources/codegen",
exclude: [
"main.swift", "enumDecl.swift", "functionExtension.swift", "parseHeaders.swift",
"structExtension.swift",
],
sources: [
"changeCases.swift"
]),
.target(
name: "MuJoCoCSyntax",
dependencies: ["ChangeCases"],
path: "Sources/codegen",
exclude: ["changeCases.swift", "main.swift"],
sources: [
"enumDecl.swift",
"functionExtension.swift",
"parseHeaders.swift",
"structExtension.swift",
]),
.executableTarget(
name: "codegen",
dependencies: ["MuJoCoCSyntax"],
path: "Sources/codegen",
exclude: [
"changeCases.swift", "enumDecl.swift", "functionExtension.swift", "parseHeaders.swift",
"structExtension.swift",
],
sources: [
"main.swift"
]),
.testTarget(
name: "Tests",
dependencies: ["MuJoCo"],
path: "Tests",
exclude: ["main.swift", "BUILD.bazel"]),
]
)