-
Notifications
You must be signed in to change notification settings - Fork 166
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 2e75fe7
Showing
3 changed files
with
41 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use std::env; | ||
|
||
fn main() { | ||
let features: Vec<String> = env::vars() | ||
.filter_map(|(key, _)| { | ||
if key.starts_with("CARGO_FEATURE_RISCV") { | ||
Some(key) | ||
} else { | ||
None | ||
} | ||
}) | ||
.collect(); | ||
|
||
if features.len() != 1 { | ||
panic!( | ||
"Exactly one RISC-V Base Extension feature must be enabled. Provided: {:?}", | ||
features | ||
); | ||
} | ||
} |