Skip to content

Commit

Permalink
riscv-semihosting: build: use cfg-check directives in build script
Browse files Browse the repository at this point in the history
Uses new lint checks for `cfg` variables.
  • Loading branch information
rmsyn committed May 7, 2024
1 parent 4dd8a43 commit a537aa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions riscv-semihosting/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Changed

- Made `cfg` variable selection more robust for custom targets

## [v0.1.0] - 2023-01-18

- Add recommendation for `semihosting` in README.md.
Expand Down
2 changes: 2 additions & 0 deletions riscv-semihosting/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::env;

fn main() {
println!("cargo:rustc-check-cfg=cfg(riscv)");

let target = env::var("TARGET").unwrap();

if target.starts_with("riscv") {
Expand Down

0 comments on commit a537aa8

Please sign in to comment.