make it possible to build without simulator SDL lib, to make crosscompile possible

This commit is contained in:
2025-09-05 01:13:26 +02:00
parent 7e198ec953
commit b80da21bf3
4 changed files with 14 additions and 7 deletions

View File

@@ -15,11 +15,12 @@ reqwest = { version = "0.12", default-features = false, features = ["http2","ru
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.143"
bincode = "2.0.1"
embedded-graphics-simulator = "0.7.0"
embedded-graphics-simulator = { version = "0.7.0", optional = true }
[features]
default = ["simulator"] # use simulator by default
simulator = []
default = ["simulator"]
simulator = ["embedded-graphics-simulator"] # enable only for simulator builds
epaper = []
paper-png = []

1
build_aarch_epaper.sh Normal file
View File

@@ -0,0 +1 @@
cargo build --release --no-default-features --features=epaper --target=aarch64-unknown-linux-gnu

View File

@@ -47,8 +47,13 @@ mod epaper;
#[cfg(feature = "epaper")]
pub use epaper::EPaper;
mod image_sim;
mod simulator;
pub use image_sim::ImageSimulator;
#[cfg(feature = "simulator")]
mod simulator;
#[cfg(feature = "simulator")]
pub use simulator::Simulator;
#[cfg(feature = "paper-png")]
mod image_sim;
#[cfg(feature = "paper-png")]
pub use image_sim::ImageSimulator;

View File

@@ -38,7 +38,7 @@ fn main() {
let display = display::Simulator::new();
#[cfg(feature = "epaper")]
let display = display::EPaper::new();
let display = display::EPaper::new().unwrap();
let mut app = app::App::new(98685373, display);
app.init();