#![warn(clippy::all, rust_2018_idioms)]
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release

mod app;

// When compiling natively:
#[cfg(not(target_arch = "wasm32"))]
fn main() -> eframe::Result {
    env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).

    let native_options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default()
            .with_inner_size([400.0, 300.0])
            .with_min_inner_size([300.0, 220.0])
            .with_icon(app::load_icon()),
        ..Default::default()
    };
    eframe::run_native(
        app::TITLE,
        native_options,
        Box::new(|cc| Ok(Box::new(app::RollatorApp::new_with_cli(cc)))),
    )
}

// TODO: add a main for compiling to wasm
#[cfg(target_arch = "wasm32")]
fn main() {
    compile_error!("compiling for wasm is not implemented")
}