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

Compile swift-library for iOS #275

Open
HS3003991 opened this issue Jun 9, 2024 · 3 comments
Open

Compile swift-library for iOS #275

HS3003991 opened this issue Jun 9, 2024 · 3 comments

Comments

@HS3003991
Copy link

HS3003991 commented Jun 9, 2024

Hello dear community,
I am currently trying to organize a project in which I want to access Apple's Secure Enclave operations via Rust.
I have so far managed to execute operations on the Secure Enclave via MacOS using a binary.
Now my next step would be to implement the same for iOS and then call it wrapped in a Rust library from Flutter.
My problem right now is that I can only get the Swift library compiled for MacOS (as you can see in the screenshot "arm64-apple-macosx"). Is there a way to compile it for iOS as well?
I am mainly following the example of Chinedufn (“rust-binary-calls-swift-package”).

I would be very happy to receive help. :)

Bildschirmfoto 2024-06-09 um 23 44 37
@chinedufn
Copy link
Owner

Hey. You can try targeting aarch64-apple-ios.

TARGETS=""
if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then
TARGETS="aarch64-apple-ios-sim,x86_64-apple-ios"
else
TARGETS="aarch64-apple-ios,x86_64-apple-ios"
fi

Feel free to re-open if yo need more help.

@HS3003991
Copy link
Author

HS3003991 commented Jun 9, 2024

Hello chinedufn,
thank you very much for your quick support and your developed bridge.
I already tried it to build for "aarch64-apple-ios". And I got a big error with the note "= note: ld: building for 'iOS', but linking in object file (/Users/danielreimer/dev/github/binary_knights/implemented_CAL_environment/target/aarch64-apple-ios/debug/deps/libapple_secure_enclave_bindings-655cb33c1ed02cd8.rlib6) built for 'macOS'
clang: error: linker command failed with exit code 1 (use -v to see invocation)"

@chinedufn
Copy link
Owner

@chinedufn chinedufn reopened this Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants