Skip to content

Commit 2afe387

Browse files
committed
riscv: build: use cfg-check directives in build script
Uses new lint checks for `cfg` variables.
1 parent 942a45e commit 2afe387

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

riscv/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
use std::env;
22

33
fn main() {
4+
println!("cargo:rustc-check-cfg=cfg(riscv)");
5+
println!("cargo:rustc-check-cfg=cfg(riscv32)");
6+
println!("cargo:rustc-check-cfg=cfg(riscv64)");
7+
48
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
59

610
if target_arch == "riscv32" {

0 commit comments

Comments
 (0)