0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 03:52:17 +02:00
libsignal/swift/Benchmarks/Package.swift
Jordan Rose d2f7ba244b swift: Match debug/release when building benchmarks
Benchmarks should normally be run in the release configuration, but CI
just wants to make sure they still work by running them with a debug
libsignal_ffi.a. Instead of making that a fallback, make it
configuration-dependent, so you can't ever accidentally test the wrong
thing.
2024-03-15 09:58:02 -07:00

39 lines
1.1 KiB
Swift

// swift-tools-version:5.2
//
// Copyright 2024 Signal Messenger, LLC.
// SPDX-License-Identifier: AGPL-3.0-only
//
import PackageDescription
let rustReleaseBuildDir = "../../target/release/"
let rustDebugBuildDir = "../../target/debug/"
let package = Package(
name: "Benchmarks",
platforms: [
.macOS(.v10_15), .iOS(.v13),
],
products: [
.executable(name: "Benchmarks", targets: ["Benchmarks"]),
],
dependencies: [
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"),
.package(path: ".."),
],
targets: [
.target(
name: "Benchmarks",
dependencies: [
.product(name: "Benchmark", package: "swift-benchmark"),
.product(name: "LibSignalClient", package: "swift" /* the folder name, sigh */ ),
],
linkerSettings: [
.unsafeFlags(["-L\(rustReleaseBuildDir)"], .when(configuration: .release)),
.unsafeFlags(["-L\(rustDebugBuildDir)"], .when(configuration: .debug)),
]
),
]
)