mirror of
https://github.com/hulthe/inkopslista.git
synced 2026-08-03 23:11:28 +02:00
Make it build for Android
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#[unsafe(no_mangle)]
|
||||
fn android_main(app: slint::android::AndroidApp) {
|
||||
slint::android::init(app).unwrap();
|
||||
|
||||
if let Err(e) = crate::run() {
|
||||
eprintln!("{e:?}");
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,9 @@
|
||||
mod config;
|
||||
mod runtime;
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
mod android;
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
mod wasm;
|
||||
|
||||
@@ -96,6 +99,9 @@ pub fn run() -> Result<(), anyhow::Error> {
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
let conf = Config::default();
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
let conf = Config::default();
|
||||
|
||||
state.set_server_address(conf.address.to_shared_string());
|
||||
let conf_shared = Arc::new(Mutex::new(conf));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user