From ebb2ab6809ea2b05d80b31c7cef6f8c98ae7e025 Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Sun, 22 Jan 2023 10:26:46 +0800 Subject: [PATCH] os-gate ios stuff --- apps/mobile/rust/ios/Cargo.toml | 4 +++- apps/mobile/rust/ios/src/lib.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/mobile/rust/ios/Cargo.toml b/apps/mobile/rust/ios/Cargo.toml index db1732346..26b034bad 100644 --- a/apps/mobile/rust/ios/Cargo.toml +++ b/apps/mobile/rust/ios/Cargo.toml @@ -11,11 +11,13 @@ rust-version = "1.64.0" # which are only available when linking against the app's ObjC crate-type = ["staticlib"] -[dependencies] + +[target.'cfg(target_os = "ios")'.dependencies] # FFI objc = "0.2.7" objc_id = "0.1.1" objc-foundation = "0.1.1" +[dependencies] # Core mobile handling stuff sd-core-mobile = { path = "../mobile" } diff --git a/apps/mobile/rust/ios/src/lib.rs b/apps/mobile/rust/ios/src/lib.rs index f94531e5f..5fe98fb80 100644 --- a/apps/mobile/rust/ios/src/lib.rs +++ b/apps/mobile/rust/ios/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg(target_os = "ios")] + use std::{ ffi::{CStr, CString}, os::raw::{c_char, c_void},