-
Notifications
You must be signed in to change notification settings - Fork 261
iOS Build Support #1054
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
base: main
Are you sure you want to change the base?
iOS Build Support #1054
Conversation
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
The lightpanda executable cannot be built for iOS. build.zig should be modified to produce a liblightpanda.a file that can be included in an xcframework.
What about adding a new step for ios only generating this lib?
And erroring the steps not compatibles w/ ios?
src/app.zig
Outdated
} | ||
|
||
if (@import("builtin").os.tag == .ios) { | ||
return null; // getAppDataDir is not available on iOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an alternative dir to use on ios?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I inlined the macOS version.
build.zig
Outdated
mbedtls.addIncludePath(b.path(root ++ "library")); | ||
|
||
mbedtls.addCSourceFiles(.{ .flags = &.{}, .files = &.{ | ||
mbedtls.addCSourceFiles(.{ .flags = &.{"-Wno-nullability-completeness"}, .files = &.{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about changing this flag for all build.
Maybe it could be conditional for ios only for now? Or is there another reason to use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adjusted it to only add that flag for iOS builds.
I added a We're going to want this static lib on other platforms too, so I didn't restrict it to iOS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you rebase the PR to remove the .DS_Store
file 🙏
May I suggest you to configure a global .gitgnore
file to avoid the risk of committing these kind of files. We don't want to add this into the project's gitignore because it relates to the dev workspace.
// static lib | ||
// ------- | ||
const static_lib_module = b.addModule("lightpanda", .{ | ||
.root_source_file = b.path("src/lib.zig"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an error b/c this file is missing when I'm trying to run zig build static-lib
This adds support for building dependencies for iOS. It depends on lightpanda-io/zig-v8-fork#96 for v8.
Lightpanda can be built for iOS with these commands:
Note
The lightpanda executable cannot be built for iOS.
build.zig
should be modified to produce aliblightpanda.a
file that can be included in an xcframework.