Skip to content

Commit

Permalink
Fix module map in xcframework (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xh3rman authored Sep 15, 2024
1 parent 2f1200c commit 3f95171
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gemstone/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ install-android-targets:
cargo install cargo-ndk

test-ios:
@xcodebuild -project tests/ios/GemTest/GemTest.xcodeproj \
@set -o pipefail && xcodebuild -project tests/ios/GemTest/GemTest.xcodeproj \
-scheme GemTest \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,name=iPhone 15" \
Expand All @@ -53,7 +53,7 @@ export GEN_KOTLIN_FOLDER := "generated/kotlin"
export TARGET_XC_FW_FOLDER := "target/spm"
export FW_FFI_NAME := FW_NAME + "FFI"
export FW_FFI_FILE := FW_FFI_NAME + ".framework"
export XC_FW_FFI_NAME := "FW_FFI_NAME" + ".xcframework"
export XC_FW_FFI_NAME := FW_FFI_NAME + ".xcframework"
export DEPLOYMENT_TARGET := env_var_or_default("IPHONEOS_DEPLOYMENT_TARGET", "16.0")

build-ios: build-targets bindgen-swift assemble-frameworks xcframework cp-xcframework-source
Expand All @@ -73,13 +73,15 @@ bindgen-swift:
assemble-frameworks:
#!/usr/bin/env bash
cat << MODULE_MAP >/dev/null
MODULE_MAP=$(
cat << EOF
// This file was autogenerated by some hot garbage in the uniffi crate.
framework module ${FW_FFI_NAME} {
header "${FW_FFI_NAME}.h"
export *
}
MODULE_MAP
EOF
)
cd ${TARGET_DIR} && find . -type d -name ${FW_FFI_FILE} | xargs rm -rf
for target in aarch64-apple-ios-sim aarch64-apple-ios aarch64-apple-ios-macabi; do \
pushd ${TARGET_DIR}/${target}/${BUILD_MODE_TARGET} > /dev/null && \
Expand Down

0 comments on commit 3f95171

Please sign in to comment.