-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
45 lines (38 loc) · 1.2 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
42
43
44
45
use esp_build::assert_unique_used_features;
fn main() {
// NOTE: update when adding new device support!
// Ensure that exactly one chip has been specified:
assert_unique_used_features!("esp32", "esp32c6", "esp32s3");
let target = std::env::var("TARGET").unwrap();
#[cfg(feature = "esp32")]
{
#[cfg(feature = "valid-pin")]
compile_error!("feature 'valid-pin' is not supported on esp32");
assert!(
target == "xtensa-esp32-none-elf",
"feature esp32 does not match target {}",
target
);
println!("cargo:rustc-cfg=esp32");
}
#[cfg(feature = "esp32s3")]
{
#[cfg(feature = "valid-pin")]
compile_error!("feature 'valid-pin' is not supported on esp32s3");
assert!(
target == "xtensa-esp32s3-none-elf",
"feature esp32s3 does not match target {}",
target
);
println!("cargo:rustc-cfg=esp32s3");
}
#[cfg(feature = "esp32c6")]
{
assert!(
target == "riscv32imac-unknown-none-elf",
"feature esp32c6 does not match target {}",
target
);
println!("cargo:rustc-cfg=esp32c6");
}
}