From bec0cc6055a16dcacd368d6937df3acd19da35dd Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Mon, 16 Aug 2021 23:32:31 +0100 Subject: [PATCH] Make alloc an optional default feature --- agb/Cargo.toml | 5 +++-- agb/src/lib.rs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/agb/Cargo.toml b/agb/Cargo.toml index 8b651160..12b7bf1f 100644 --- a/agb/Cargo.toml +++ b/agb/Cargo.toml @@ -14,8 +14,9 @@ debug = true lto = true debug = true - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["alloc"] +alloc = [] [dependencies] bitflags = "1.2" diff --git a/agb/src/lib.rs b/agb/src/lib.rs index 38a8f443..8864b605 100644 --- a/agb/src/lib.rs +++ b/agb/src/lib.rs @@ -13,7 +13,10 @@ //! internal workings of the Game Boy Advance whilst still being high //! performance and memory efficient. +#[cfg(feature = "alloc")] extern crate alloc; +#[cfg(feature = "alloc")] +mod agb_alloc; /// Implements everything relating to things that are displayed on screen. pub mod display; @@ -34,8 +37,6 @@ pub mod mgba; pub mod number; mod single; -mod agb_alloc; - /// System BIOS calls / syscalls. pub mod syscall;