Add flag to force debug mode

This commit is contained in:
Niko 2023-12-15 21:20:39 -07:00
parent 755d9e590f
commit b5cddefcfa
No known key found for this signature in database
GPG key ID: 3861E636EA1E0E2B
2 changed files with 5 additions and 2 deletions

View file

@ -41,11 +41,14 @@ include = [
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features] [features]
default = ["force-debug"]
coreml = [] coreml = []
cuda = [] cuda = []
opencl = [] opencl = []
openblas = [] openblas = []
metal = [] metal = []
force-debug = []
[build-dependencies] [build-dependencies]
cmake = "0.1" cmake = "0.1"

View file

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