From b5cddefcfa441ae8b43e0874d09b187e6b1e16fd Mon Sep 17 00:00:00 2001 From: Niko Date: Fri, 15 Dec 2023 21:20:39 -0700 Subject: [PATCH] Add flag to force debug mode --- sys/Cargo.toml | 3 +++ sys/build.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/Cargo.toml b/sys/Cargo.toml index b429860..90a2183 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -41,11 +41,14 @@ include = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] +default = ["force-debug"] + coreml = [] cuda = [] opencl = [] openblas = [] metal = [] +force-debug = [] [build-dependencies] cmake = "0.1" diff --git a/sys/build.rs b/sys/build.rs index 2dc3d45..1628bf5 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -138,10 +138,10 @@ fn main() { 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, // 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();