Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: fix ios simulator build

Nathan73757dad6baa
diff --git a/frontend/rust-lib/.cargo/config.toml b/frontend/rust-lib/.cargo/config.toml
index 2e64e5e484..2deecb2ed8 100644
--- a/frontend/rust-lib/.cargo/config.toml
+++ b/frontend/rust-lib/.cargo/config.toml
@@ -6,4 +6,7 @@ rustflags = ["-C", "link-arg=-mmacosx-version-min=11.0"]
rustflags = ["-C", "link-arg=-mmacosx-version-min=11.0"]
[target.aarch64-apple-ios]
-rustflags = ["-C", "link-arg=-miphoneos-version-min=10.0"]
\ No newline at end of file
+rustflags = ["-C", "link-arg=-miphoneos-version-min=10.0"]
+
+[target.aarch64-apple-ios-sim]
+rustflags = ["-C", "link-arg=-mios-simulator-version-min=10.0"]
diff --git a/frontend/scripts/makefile/mobile.toml b/frontend/scripts/makefile/mobile.toml
index 56329a2936..861c786d7e 100644
--- a/frontend/scripts/makefile/mobile.toml
+++ b/frontend/scripts/makefile/mobile.toml
@@ -26,6 +26,17 @@ private = true
script = [
"""
cd rust-lib/
+
+ # Set environment variables for iOS simulator builds to fix bindgen issues
+ # This prevents the "stdbool.h file not found" error when building for iOS simulator
+ if [[ "${RUST_COMPILE_TARGET}" == *"ios-sim"* ]]; then
+ echo "πŸ”§ Setting up environment for iOS Simulator build..."
+ export SDKROOT="$(xcrun --sdk iphonesimulator --show-sdk-path)"
+ export BINDGEN_EXTRA_CLANG_ARGS="-target arm64-apple-ios14.0-simulator -isysroot $(xcrun --sdk iphonesimulator --show-sdk-path)"
+ echo "πŸ“± SDKROOT: $SDKROOT"
+ echo "πŸ› οΈ BINDGEN_EXTRA_CLANG_ARGS: $BINDGEN_EXTRA_CLANG_ARGS"
+ fi
+
if [ "${BUILD_FLAG}" = "debug" ]; then
echo "πŸš€ πŸš€ πŸš€ Building iOS SDK for debug"
cargo lipo --targets ${RUST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_FEATURES}" --package=dart-ffi