From 6728118e9af3ebeafc3ee0c6a60cbd5ef2cb43aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Wed, 23 Oct 2024 17:55:10 +0200 Subject: [PATCH] fix and check compilation with no features --- .github/workflows/ci.yml | 3 +++ src/config.rs | 1 + src/generate/device.rs | 3 +++ 3 files changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6dec204..a7ec6239 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,9 @@ jobs: with: key: ${{ matrix.TARGET }} + - run: cargo check --target ${{ matrix.TARGET }} --no-default-features + env: + RUSTFLAGS: -D warnings - run: cargo check --target ${{ matrix.TARGET }} env: RUSTFLAGS: -D warnings diff --git a/src/config.rs b/src/config.rs index 5a48105c..07bd566b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -37,6 +37,7 @@ pub struct Config { pub base_address_shift: u64, pub html_url: Option, /// Path to YAML file with chip-specific settings + #[cfg(feature = "yaml")] pub settings: Option, } diff --git a/src/generate/device.rs b/src/generate/device.rs index 9f0ff909..c2be289f 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -28,6 +28,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { let file = std::fs::read_to_string(settings).context("could not read settings file")?; @@ -35,6 +36,8 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result None, }; + #[cfg(not(feature = "yaml"))] + let settings = None; if config.target == Target::Msp430 { out.extend(quote! {