Skip to content

Commit 7271873

Browse files
committed
Issue a build warning for debug builds
1 parent b0c3ec6 commit 7271873

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fn main() {
2+
let profile = std::env::var("PROFILE").unwrap();
3+
let target = std::env::var("TARGET").unwrap();
4+
5+
if profile == "debug" && !target.starts_with("x86_64") {
6+
println!("cargo:warning=synopsys-usb-otg is being compiled in debug mode. This driver works reliably only in release mode!");
7+
}
8+
}

0 commit comments

Comments
 (0)