diff --git a/.github/workflows/ci-builds.yml b/.github/workflows/ci-builds.yml index a2cfcb0f..271ef033 100644 --- a/.github/workflows/ci-builds.yml +++ b/.github/workflows/ci-builds.yml @@ -13,7 +13,7 @@ jobs: - { toolchain: nightly } steps: - uses: actions/checkout@v2 - + - name: Install Apt Dependencies run: sudo apt-get update && sudo apt-get install binutils-arm-none-eabi @@ -32,3 +32,10 @@ jobs: toolchain: ${{ matrix.rust.toolchain }} command: build args: --examples + + - name: Check compilation succeeds when not on the GBA (check to prevent complaints about missing things) + uses: actions-rs/cargo@v1 + with: + toolchain: ${{ matrix.rust.toolchain }} + command: check + args: --no-default-features diff --git a/src/lib.rs b/src/lib.rs index 06d77795..10485a8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -87,6 +87,7 @@ //! break any of these assumptions, if you do that some or all of the code //! provided by this crate may become unsound. +#[cfg(feature = "on_gba")] use prelude::{GbaCell, IrqFn}; mod macros; @@ -118,6 +119,7 @@ pub mod video; /// The function pointer that the assembly runtime calls when an interrupt /// occurs. +#[cfg(feature = "on_gba")] pub static RUST_IRQ_HANDLER: GbaCell> = GbaCell::new(None); /// Wraps a value to be aligned to a minimum of 4. diff --git a/src/video/mod.rs b/src/video/mod.rs index b876afb1..8738c236 100644 --- a/src/video/mod.rs +++ b/src/video/mod.rs @@ -326,6 +326,7 @@ impl TextEntry { } #[inline] +#[cfg(feature = "on_gba")] pub fn video3_clear_to(c: Color) { let u = u32::from(c.0) << 16 | u32::from(c.0); unsafe { @@ -350,6 +351,7 @@ impl Video3Bitmap { } #[inline] +#[cfg(feature = "on_gba")] pub fn video3_set_bitmap(bitmap: &Video3Bitmap) { let p = VIDEO3_VRAM.as_usize() as *mut _; unsafe { @@ -365,6 +367,7 @@ pub struct Video4Indexmap(pub [u8; 240 * 160]); /// ## Panics /// Only frames 0 and 1 exist, if `frame` is 2 or more this will panic. #[inline] +#[cfg(feature = "on_gba")] pub fn video4_set_indexmap(indexes: &Video4Indexmap, frame: usize) { let p = VIDEO4_VRAM.get_frame(usize::from(frame)).unwrap().as_usize() as *mut [u32; 8];