From 62994578c21a467b1f6862e97981b8eabd4ee4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Quentin?= Date: Tue, 10 Dec 2024 16:32:29 +0100 Subject: [PATCH] Fix qa-test build.rs (#2722) * Fix qa-test build.rs * Once is enough --- qa-test/build.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qa-test/build.rs b/qa-test/build.rs index 4be49f0b6..04019a531 100644 --- a/qa-test/build.rs +++ b/qa-test/build.rs @@ -2,8 +2,11 @@ fn main() { // Allow building QA tests in CI in debug mode println!("cargo:rustc-check-cfg=cfg(is_not_release)"); println!("cargo:rerun-if-env-changed=CI"); - #[cfg(debug_assertions)] if std::env::var("CI").is_err() { - println!("cargo::rustc-cfg=is_not_release"); + if let Ok(level) = std::env::var("OPT_LEVEL") { + if level == "0" || level == "1" { + println!("cargo::rustc-cfg=is_not_release"); + } + } } }