Fix ios lib build

This commit is contained in:
Ethan O'Brien
2025-11-30 12:01:25 -06:00
parent d4a5f0dd11
commit 66f97c48ee
3 changed files with 67 additions and 2 deletions

60
Cargo.lock generated
View File

@@ -330,6 +330,15 @@ dependencies = [
"generic-array",
]
[[package]]
name = "block2"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"
dependencies = [
"objc2",
]
[[package]]
name = "brotli"
version = "8.0.2"
@@ -584,6 +593,16 @@ dependencies = [
"subtle",
]
[[package]]
name = "dispatch2"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec"
dependencies = [
"bitflags",
"objc2",
]
[[package]]
name = "displaydoc"
version = "0.2.5"
@@ -630,6 +649,8 @@ dependencies = [
"libflate",
"md5",
"mime",
"objc2",
"objc2-foundation",
"pem",
"rand 0.9.2",
"rsa",
@@ -1314,6 +1335,45 @@ dependencies = [
"libm",
]
[[package]]
name = "objc2"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05"
dependencies = [
"objc2-encode",
]
[[package]]
name = "objc2-core-foundation"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
dependencies = [
"bitflags",
"dispatch2",
"objc2",
]
[[package]]
name = "objc2-encode"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"
[[package]]
name = "objc2-foundation"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
dependencies = [
"bitflags",
"block2",
"libc",
"objc2",
"objc2-core-foundation",
]
[[package]]
name = "once_cell"
version = "1.21.3"

View File

@@ -32,9 +32,14 @@ include_dir = { version = "0.7.4", optional = true }
[target.aarch64-linux-android.dependencies]
jni = { version = "0.21.1", features = ["invocation", "default"] }
[target.aarch64-apple-ios.dependencies]
objc2 = "0.6.3"
objc2-foundation = { version = "0.3.2", features = ["NSFileManager"] }
[build-dependencies]
cc = "1.0"
# To enable this library you MUST comment out lib block below and add --features library
[features]
library = ["dep:include_dir"]

View File

@@ -7,10 +7,10 @@ pub static INITIALIZER: extern "C" fn() = main;
#[unsafe(no_mangle)]
pub extern "C" fn main() {
let data_path = get_bundle_path().into_os_string().into_string().unwrap();
android::set_datapath(data_path);
//set_datapath(data_path);
std::thread::spawn(|| {
run_server(true).unwrap();
crate::run_server(true).unwrap();
});
}