From a537aa8e5553a6ac3135df5f3650d77c66f9a468 Mon Sep 17 00:00:00 2001 From: rmsyn Date: Sun, 5 May 2024 20:59:30 +0000 Subject: [PATCH] riscv-semihosting: build: use cfg-check directives in build script Uses new lint checks for `cfg` variables. --- riscv-semihosting/CHANGELOG.md | 4 ++++ riscv-semihosting/build.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/riscv-semihosting/CHANGELOG.md b/riscv-semihosting/CHANGELOG.md index 53333769..f48294c8 100644 --- a/riscv-semihosting/CHANGELOG.md +++ b/riscv-semihosting/CHANGELOG.md @@ -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. diff --git a/riscv-semihosting/build.rs b/riscv-semihosting/build.rs index 298364fd..bc7e7f73 100644 --- a/riscv-semihosting/build.rs +++ b/riscv-semihosting/build.rs @@ -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") {