-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPackage.swift
46 lines (39 loc) · 1.42 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.4
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
var libraryType: Product.Library.LibraryType? = nil
#if os(Windows)
libraryType = .dynamic
#endif
var settings: [SwiftSetting]? {
var array: [SwiftSetting] = []
#if false
// A little bit faster on old hardware, but less accurate.
// Theres no reason to use this on modern hardware.
array.append(.define("GameMathUseFastInverseSquareRoot"))
#endif
// These settings are faster only with optimization.
#if true
array.append(.define("GameMathUseSIMD", .when(configuration: .release)))
array.append(.define("GameMathUseLoopVectorization", .when(configuration: .release)))
#endif
return array.isEmpty ? nil : array
}
let package = Package(
name: "GameMath",
products: [
.library(name: "GameMath", type: libraryType, targets: ["GameMath"]),
],
targets: [
.target(name: "GameMath", swiftSettings: settings),
.testTarget(name: "GameMathTests",
dependencies: ["GameMath"]),
.testTarget(name: "GameMathSIMDTests",
dependencies: ["GameMath"],
swiftSettings: [
.define("GameMathUseSIMD"),
.define("GameMathUseLoopVectorization")
]),
],
swiftLanguageVersions: [.v5]
)