slint/examples/carousel/rust/main.rs
Olivier Goffart 580b1375cb carousel: use "mcu-board-support" as feature name, so it is easier to use
then we just enable the support for the pico with --features=mcu-board-support/pico-st7789
2022-10-20 08:01:34 +02:00

33 lines
969 B
Rust

// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
#![cfg_attr(feature = "mcu-board-support", no_std)]
#![cfg_attr(all(feature = "mcu-board-support", not(simulator)), no_main)]
#[cfg(feature = "mcu-board-support")]
extern crate alloc;
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
slint::include_modules!();
#[cfg(not(feature = "mcu-board-support"))]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
pub fn main() {
// This provides better error messages in debug mode.
// It's disabled in release mode so it doesn't bloat up the file size.
#[cfg(all(debug_assertions, target_arch = "wasm32"))]
console_error_panic_hook::set_once();
MainWindow::new().run()
}
#[cfg(feature = "mcu-board-support")]
#[mcu_board_support::entry]
fn main() -> ! {
mcu_board_support::init();
MainWindow::new().run();
panic!("The MCU demo should not quit")
}