0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-19 19:42:19 +02:00

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.
This commit is contained in:
Jordan Rose 2024-03-13 12:41:28 -07:00
parent 37042dd2fa
commit d2f7ba244b

View File

@ -7,8 +7,8 @@
import PackageDescription
let rustBuildDir = "../../target/release/"
let rustFallbackBuildDir = "../../target/debug/"
let rustReleaseBuildDir = "../../target/release/"
let rustDebugBuildDir = "../../target/debug/"
let package = Package(
name: "Benchmarks",
@ -29,10 +29,10 @@ let package = Package(
.product(name: "Benchmark", package: "swift-benchmark"),
.product(name: "LibSignalClient", package: "swift" /* the folder name, sigh */ ),
],
linkerSettings: [.unsafeFlags([
"-L\(rustBuildDir)",
"-L\(rustFallbackBuildDir)",
])]
linkerSettings: [
.unsafeFlags(["-L\(rustReleaseBuildDir)"], .when(configuration: .release)),
.unsafeFlags(["-L\(rustDebugBuildDir)"], .when(configuration: .debug)),
]
),
]
)