-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Package.swift
46 lines (41 loc) · 1.31 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
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
/// We define global swift settings to control SIMD usage.
/// The gist is, that we will import and use SIMD implementations where available.
/// Otherwise we fall back to our own implementation.
var swiftSettings: [SwiftSetting] = []
#if canImport(simd)
swiftSettings.append(.define("FRB_MATH_USE_SIMD"))
#endif
#if canImport(Darwin)
swiftSettings.append(.define("FRB_MATH_DARWIN"))
#elseif canImport(Glibc)
swiftSettings.append(.define("FRB_MATH_GLIBC"))
#elseif canImport(Foundation)
swiftSettings.append(.define("FRB_MATH_FOUNDATION"))
#endif
#if os(Windows)
let libraryType : Product.Library.LibraryType = .dynamic
#else
let libraryType : Product.Library.LibraryType = .static
#endif
let package = Package(
name: "FirebladeMath",
products: [
.library(
name: "FirebladeMath",
type: libraryType,
targets: ["FirebladeMath"])
],
targets: [
.target(
name: "FirebladeMath",
dependencies: [],
swiftSettings: swiftSettings),
.testTarget(
name: "FirebladeMathTests",
dependencies: ["FirebladeMath"],
swiftSettings: swiftSettings)
]
)