|
| 1 | +// swift-tools-version:5.4 |
| 2 | +//===--- Package.swift ----------------------------------------*- swift -*-===// |
| 3 | +// |
| 4 | +// This source file is part of the Swift Numerics open source project |
| 5 | +// |
| 6 | +// Copyright (c) 2019-2021 Apple Inc. and the Swift Numerics project authors |
| 7 | +// Licensed under Apache License v2.0 with Runtime Library Exception |
| 8 | +// |
| 9 | +// See https://swift.org/LICENSE.txt for license information |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | + |
| 13 | +import PackageDescription |
| 14 | + |
| 15 | +let excludedFilenames = ["CMakeLists.txt", "README.md"] |
| 16 | + |
| 17 | +let package = Package( |
| 18 | + |
| 19 | + name: "swift-numerics", |
| 20 | + products: [ |
| 21 | + .library(name: "ComplexModule", targets: ["ComplexModule"]), |
| 22 | + .library(name: "Numerics", targets: ["Numerics"]), |
| 23 | + .library(name: "RealModule", targets: ["RealModule"]), |
| 24 | + ], |
| 25 | + |
| 26 | + targets: [ |
| 27 | + // MARK: - Public API |
| 28 | + .target( |
| 29 | + name: "ComplexModule", |
| 30 | + dependencies: ["RealModule"], |
| 31 | + exclude: excludedFilenames |
| 32 | + ), |
| 33 | + |
| 34 | + .target( |
| 35 | + name: "IntegerUtilities", |
| 36 | + dependencies: [], |
| 37 | + exclude: excludedFilenames |
| 38 | + ), |
| 39 | + |
| 40 | + .target( |
| 41 | + name: "Numerics", |
| 42 | + dependencies: ["ComplexModule", "IntegerUtilities", "RealModule"], |
| 43 | + exclude: excludedFilenames |
| 44 | + ), |
| 45 | + |
| 46 | + .target( |
| 47 | + name: "RealModule", |
| 48 | + dependencies: ["_NumericsShims"], |
| 49 | + exclude: excludedFilenames |
| 50 | + ), |
| 51 | + |
| 52 | + // MARK: - Implementation details |
| 53 | + .target( |
| 54 | + name: "_NumericsShims", |
| 55 | + exclude: excludedFilenames, |
| 56 | + linkerSettings: [.linkedLibrary("m", .when(platforms: [.linux, .android]))] |
| 57 | + ), |
| 58 | + |
| 59 | + .target( |
| 60 | + name: "_TestSupport", |
| 61 | + dependencies: ["Numerics"], |
| 62 | + exclude: ["CMakeLists.txt"] |
| 63 | + ), |
| 64 | + |
| 65 | + // MARK: - Unit test bundles |
| 66 | + .testTarget( |
| 67 | + name: "ComplexTests", |
| 68 | + dependencies: ["_TestSupport"], |
| 69 | + exclude: ["CMakeLists.txt"] |
| 70 | + ), |
| 71 | + |
| 72 | + .testTarget( |
| 73 | + name: "IntegerUtilitiesTests", |
| 74 | + dependencies: ["IntegerUtilities", "_TestSupport"], |
| 75 | + exclude: ["CMakeLists.txt"] |
| 76 | + ), |
| 77 | + |
| 78 | + .testTarget( |
| 79 | + name: "RealTests", |
| 80 | + dependencies: ["_TestSupport"], |
| 81 | + exclude: ["CMakeLists.txt"] |
| 82 | + ), |
| 83 | + |
| 84 | + // MARK: - Test executables |
| 85 | + .executableTarget( |
| 86 | + name: "ComplexLog", |
| 87 | + dependencies: ["Numerics", "_TestSupport"], |
| 88 | + path: "Tests/Executable/ComplexLog" |
| 89 | + ), |
| 90 | + |
| 91 | + .executableTarget( |
| 92 | + name: "ComplexLog1p", |
| 93 | + dependencies: ["Numerics", "_TestSupport"], |
| 94 | + path: "Tests/Executable/ComplexLog1p" |
| 95 | + ) |
| 96 | + ] |
| 97 | +) |
0 commit comments