diff --git a/rustboyadvance-core/src/core/cartridge/builder.rs b/rustboyadvance-core/src/core/cartridge/builder.rs index 1114e84..3e9f87f 100644 --- a/rustboyadvance-core/src/core/cartridge/builder.rs +++ b/rustboyadvance-core/src/core/cartridge/builder.rs @@ -86,11 +86,13 @@ impl GamepakBuilder { pub fn build(mut self) -> GBAResult { let (bytes, symbols) = if let Some(bytes) = self.bytes { match load_from_bytes(bytes.to_vec())? { + #[cfg(feature = "elf_support")] LoadRom::Elf { data, symbols } => Ok((data, Some(symbols))), LoadRom::Raw(data) => Ok((data, None)), } } else if let Some(path) = &self.path { match load_from_file(&path)? { + #[cfg(feature = "elf_support")] LoadRom::Elf { data, symbols } => Ok((data, Some(symbols))), LoadRom::Raw(data) => Ok((data, None)), } diff --git a/rustboyadvance-core/src/core/cartridge/loader.rs b/rustboyadvance-core/src/core/cartridge/loader.rs index 49d6119..474bde5 100644 --- a/rustboyadvance-core/src/core/cartridge/loader.rs +++ b/rustboyadvance-core/src/core/cartridge/loader.rs @@ -1,4 +1,6 @@ use super::super::{GBAError, GBAResult}; + +#[cfg(feature = "elf_support")] use std::collections::HashMap; use std::io::prelude::*; use std::io::Cursor; @@ -11,6 +13,7 @@ use zip::ZipArchive; use goblin; pub enum LoadRom { + #[cfg(feature = "elf_support")] Elf { data: Vec, symbols: HashMap,