Merge pull request #158 from thewh1teagle/feat/pass-cmake-flags

feat(sys): allow passing more cmake flags
This commit is contained in:
Niko 2024-07-17 18:37:01 +00:00 committed by GitHub
commit 7634d3181f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -186,9 +186,12 @@ fn main() {
config.define("CMAKE_BUILD_TYPE", "RelWithDebInfo");
}
// Allow passing any WHISPER cmake flag
// Allow passing any WHISPER or CMAKE compile flags
for (key, value) in env::vars() {
if key.starts_with("WHISPER_") && key != "WHISPER_DONT_GENERATE_BINDINGS" {
let is_whisper_flag =
key.starts_with("WHISPER_") && key != "WHISPER_DONT_GENERATE_BINDINGS";
let is_cmake_flag = key.starts_with("CMAKE_");
if is_whisper_flag || is_cmake_flag {
config.define(&key, &value);
}
}