-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use conditional dependencies in riscv-rt depending on base extension
- Loading branch information
1 parent
289206a
commit 9c3d91d
Showing
4 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
fn main() { | ||
match option_env!("RISCV_BASE_EXTENSION") { | ||
Some("RV32I") => { | ||
println!("cargo:rustc-cfg=feature=\"riscv32\""); | ||
} | ||
Some("RV32E") => { | ||
println!("cargo:rustc-cfg=feature=\"riscv32e\""); | ||
} | ||
Some("RV64I") | None => { | ||
// RV64I is the default base extension for docs | ||
println!("cargo:rustc-cfg=feature=\"riscv64\""); | ||
} | ||
Some("RV64E") => { | ||
println!("cargo:rustc-cfg=feature=\"riscv64e\""); | ||
} | ||
Some(other) => { | ||
panic!("Unsupported RISC-V base extension: {other}"); | ||
} | ||
} | ||
} |