mirror of
https://github.com/signalapp/libsignal.git
synced 2024-09-20 03:52:17 +02:00
d2f7ba244b
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.
39 lines
1.1 KiB
Swift
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)),
|
|
]
|
|
),
|
|
]
|
|
)
|