Skip to content
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

update makefile to support ios builds #276

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ ifdef CONFIG_WINDOWS
LOADABLE_EXTENSION=dll
endif

ifdef IOS_TARGET
CI_MAYBE_TARGET=$(IOS_TARGET)
rs_build_flags = -Zbuild-std
sysroot_option = --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
endif

prefix=./dist
dbg_prefix=./dbg

Expand Down Expand Up @@ -137,11 +143,14 @@ $(TARGET_LOADABLE): $(prefix) $(ext_files) $(rs_lib_loadable_cpy)
$(CC) -O2 -I./src/ -I./src/sqlite \
$(LOADABLE_CFLAGS) \
$(C_TARGET) \
$(sysroot_option) \
$(ext_files) $(rs_lib_loadable_cpy) -o $@

$(TARGET_DBG_LOADABLE): $(dbg_prefix) $(ext_files) $(rs_lib_dbg_loadable_cpy)
$(CC) -g -I./src/ -I./src/sqlite \
$(LOADABLE_CFLAGS) \
$(C_TARGET) \
$(sysroot_option) \
$(ext_files) $(rs_lib_dbg_loadable_cpy) -o $@

# Build a SQLite CLI that pre-loads cr-sqlite.
Expand Down
22 changes: 22 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# ios

https://mozilla.github.io/firefox-browser-architecture/experiments/2017-09-06-rust-on-ios.html
cargo install cargo-lipo
^-- https://github.com/TimNN/cargo-lipo/issues/60
https://www.reddit.com/r/rust/comments/12w9h4s/how_to_make_armv7appleios_target_by_myself/

```
cargo build -Zbuild-std --target=aarch64-apple-ios --features static,omit_load_extension
```

```
export CI_MAYBE_TARGET=aarch64-apple-ios
make loadable
clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]
```

^- repeat for every ios arch? How to universal binary?

https://stackoverflow.com/questions/823706/compiling-custom-sqlite-for-an-iphone-app
https://github.com/swiftlyfalling/SQLiteLib

# Prepared read

- parse values and use correct types for binding
Expand Down