-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS/Android support #1384
Comments
I successfully ran libsql on Android. I don't think I had to do anything special. What I do though is having a new Rust lib project that depends on libsql. |
Running lipo on the generated
Indeed it seems the cargo build is targeting apple ios x86_64 but the generated sqlite object file has been compiled for another arch. Looking at the build script I find nothing weird. The cc crate is used for compiling the sqlite source file which should handle cross compilation gracefully. So it seems this path with a cmake build is happening (maybe due the encryption feature being turned on?). I've added the following to try to make cross compilation work, but it doesn't seem to be doing anything: if target.contains("x86_64-apple-ios") {
cmake_opts.push(&cmake_toolchain_opt);
writeln!(toolchain_file, "set(CMAKE_SYSTEM_NAME \"iOS\")").unwrap();
writeln!(toolchain_file, "set(CMAKE_SYSTEM_PROCESSOR \"x86_64\")").unwrap();
} Edit: turning off the |
I'm trying to build static library (.a) that I can use on iOS and Android. I'm trying to compile the C experimental bindings, doing
cargo build --target [TARGET] --release
works and compiles the library correctly.The problem however lies when I try to create all three iOS archs (
x86_64-apple-ios
,aarch64-apple-ios
,aarch64-apple-ios-sim
) and then generate a single fat binary forx86_64-apple-ios
andaarch64-apple-ios-sim
, which is needed to package all of them in a single.xcframework
I get the following error:
Which seems to indicate the sqlite3mc.c object file has not been compiled for the correct architecture.
Are there some instructions to compile the library to iOS/Android? I've seen at least one person that has managed to compile it for Android.
The text was updated successfully, but these errors were encountered: