forked from bjoernQ/vl53l5-c2rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
41 lines (37 loc) · 1.05 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* build.rs
*/
fn main() {
// DEBUG: Show what we know about the compilation.
//
// <<
// CARGO_CFG_TARGET_FEATURE=c,m
// CARGO_FEATURE_{..feature..}=1
// RUSTUP_TOOLCHAIN=stable-x86_64-unknown-linux-gnu
// TARGET=riscv32imc-unknown-none-elf
// <<
//
#[cfg(not(all()))]
{
std::env::vars().for_each(|(a, b)| { eprintln!("{a}={b}"); });
std::process::exit(1);
}
{
let count= 0;
#[cfg(feature="espflash-println")]
let count = count + 1;
#[cfg(feature="espflash-log")]
let count = count + 1;
#[cfg(feature="espflash-defmt")]
let count = count + 1;
#[cfg(feature="probe_rs-defmt")]
let count = count + 1;
assert!(count > 0, "One 'espflash-*' or 'probe_rs-*' feature must be enabled");
assert!(count == 1, "Only one 'espflash-*' or 'probe_rs-*' feature must be enabled");
}
// Link arguments
{
#[cfg(feature="_defmt")]
println!("cargo::rustc-link-arg={}", "-Tdefmt.x");
}
}