Skip to content

Supported macos #16

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion hello/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ build-targets:
cargo +nightly build -Z build-std --lib --target aarch64-apple-ios-macabi
cargo +nightly build -Z build-std --lib --target x86_64-apple-ios-macabi
cargo build --lib --target aarch64-apple-ios
cargo build --lib --target aarch64-apple-darwin
cargo build --lib --target x86_64-apple-darwin

bindgen-swift:
cargo build
Expand All @@ -31,12 +33,15 @@ assemble-frameworks:
cd $(TARGET_DIR)/aarch64-apple-ios/debug && mkdir -p HelloFFI.framework && cd HelloFFI.framework && mkdir Headers Modules Resources && cp ../../../../hello/src/HelloFFI.modulemap ./Modules/module.modulemap && cp ../../../../hello/src/HelloFFI.h ./Headers/HelloFFI.h && cp ../$(STATIC_LIB_NAME) ./HelloFFI && cp ../../../../hello/misc/apple/Info.plist ./Resources
cd $(TARGET_DIR)/aarch64-apple-ios-macabi/debug && mkdir -p HelloFFI.framework && cd HelloFFI.framework && mkdir Headers Modules Resources && cp ../../../../hello/src/HelloFFI.modulemap ./Modules/module.modulemap && cp ../../../../hello/src/HelloFFI.h ./Headers/HelloFFI.h && cp ../$(STATIC_LIB_NAME) ./HelloFFI && cp ../../../../hello/misc/apple/Info.plist ./Resources
cd $(TARGET_DIR)/x86_64-apple-ios-macabi/debug && mkdir -p HelloFFI.framework && cd HelloFFI.framework && mkdir Headers Modules Resources && cp ../../../../hello/src/HelloFFI.modulemap ./Modules/module.modulemap && cp ../../../../hello/src/HelloFFI.h ./Headers/HelloFFI.h && cp ../$(STATIC_LIB_NAME) ./HelloFFI && cp ../../../../hello/misc/apple/Info.plist ./Resources
cd $(TARGET_DIR)/x86_64-apple-darwin/debug && mkdir -p HelloFFI.framework && cd HelloFFI.framework && mkdir Headers Modules Resources && cp ../../../../hello/src/HelloFFI.modulemap ./Modules/module.modulemap && cp ../../../../hello/src/HelloFFI.h ./Headers/HelloFFI.h && cp ../$(STATIC_LIB_NAME) ./HelloFFI && cp ../../../../hello/misc/apple/Info.plist ./Resources
cd $(TARGET_DIR)/aarch64-apple-darwin/debug && mkdir -p HelloFFI.framework && cd HelloFFI.framework && mkdir Headers Modules Resources && cp ../../../../hello/src/HelloFFI.modulemap ./Modules/module.modulemap && cp ../../../../hello/src/HelloFFI.h ./Headers/HelloFFI.h && cp ../$(STATIC_LIB_NAME) ./HelloFFI && cp ../../../../hello/misc/apple/Info.plist ./Resources

xcframeowrk:
lipo -create $(TARGET_DIR)/x86_64-apple-ios/debug/HelloFFI.framework/HelloFFI $(TARGET_DIR)/aarch64-apple-ios-sim/debug/HelloFFI.framework/HelloFFI -output $(TARGET_DIR)/aarch64-apple-ios-sim/debug/HelloFFI.framework/HelloFFI
lipo -create $(TARGET_DIR)/x86_64-apple-ios-macabi/debug/HelloFFI.framework/HelloFFI $(TARGET_DIR)/aarch64-apple-ios-macabi/debug/HelloFFI.framework/HelloFFI -output $(TARGET_DIR)/aarch64-apple-ios-macabi/debug/HelloFFI.framework/HelloFFI
lipo -create $(TARGET_DIR)/x86_64-apple-darwin/debug/HelloFFI.framework/HelloFFI $(TARGET_DIR)/aarch64-apple-darwin/debug/HelloFFI.framework/HelloFFI -output $(TARGET_DIR)/aarch64-apple-darwin/debug/HelloFFI.framework/HelloFFI
rm -rf $(TARGET_DIR)/HelloFFI.xcframework || echo "skip removing"
xcodebuild -create-xcframework -framework $(TARGET_DIR)/aarch64-apple-ios/debug/HelloFFI.framework -framework $(TARGET_DIR)/aarch64-apple-ios-sim/debug/HelloFFI.framework -framework $(TARGET_DIR)/aarch64-apple-ios-macabi/debug/HelloFFI.framework -output $(TARGET_DIR)/HelloFFI.xcframework
xcodebuild -create-xcframework -framework $(TARGET_DIR)/aarch64-apple-darwin/debug/HelloFFI.framework -framework $(TARGET_DIR)/aarch64-apple-ios/debug/HelloFFI.framework -framework $(TARGET_DIR)/aarch64-apple-ios-sim/debug/HelloFFI.framework -framework $(TARGET_DIR)/aarch64-apple-ios-macabi/debug/HelloFFI.framework -output $(TARGET_DIR)/HelloFFI.xcframework

cp-xcframeowrk-source:
cp -r $(TARGET_DIR)/HelloFFI.xcframework platforms/apple/Hello/Sources
Expand Down