0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 03:52:17 +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 import PackageDescription
let rustBuildDir = "../../target/release/" let rustReleaseBuildDir = "../../target/release/"
let rustFallbackBuildDir = "../../target/debug/" let rustDebugBuildDir = "../../target/debug/"
let package = Package( let package = Package(
name: "Benchmarks", name: "Benchmarks",
@ -29,10 +29,10 @@ let package = Package(
.product(name: "Benchmark", package: "swift-benchmark"), .product(name: "Benchmark", package: "swift-benchmark"),
.product(name: "LibSignalClient", package: "swift" /* the folder name, sigh */ ), .product(name: "LibSignalClient", package: "swift" /* the folder name, sigh */ ),
], ],
linkerSettings: [.unsafeFlags([ linkerSettings: [
"-L\(rustBuildDir)", .unsafeFlags(["-L\(rustReleaseBuildDir)"], .when(configuration: .release)),
"-L\(rustFallbackBuildDir)", .unsafeFlags(["-L\(rustDebugBuildDir)"], .when(configuration: .debug)),
])] ]
), ),
] ]
) )