Merge pull request #107 from tazz4843/cmake-change-build-type

Change CMake build type based on Rust build type
This commit is contained in:
Niko 2024-01-04 04:28:37 +00:00 committed by GitHub
commit eee78dabaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -46,6 +46,7 @@ cuda = []
opencl = []
openblas = []
metal = []
force-debug = []
[build-dependencies]
cmake = "0.1"

View file

@ -138,6 +138,12 @@ fn main() {
config.define("WHISPER_METAL", "OFF");
}
if cfg!(debug_assertions) || cfg!(feature = "force-debug") {
// debug builds are too slow to even remotely be usable,
// so we build with optimizations even in debug mode
config.define("CMAKE_BUILD_TYPE", "RelWithDebInfo");
}
let destination = config.build();
if env::var("TARGET").unwrap().contains("window") {