Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
carson-katri wants to merge 7 commits into lightpanda-io:main
base: main
Choose a base branch
Loading
from liveview-native:apple-platforms-build

Conversation

@carson-katri
Copy link

@carson-katri carson-katri commented Sep 16, 2025

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:

make get-v8
OS=ios make build-v8
export OS=iphonesimulator
export ARCH=arm64
export SDK=$(xcrun --sdk $OS --show-sdk-path)
export CC=$(xcrun --sdk "$SDK" -f clang)
export CXX=$(xcrun --sdk "$SDK" -f clang++)
export CPP="$CC -E"
export AR="$(xcrun --sdk "$SDK" -f ar)"
export RANLIB="$(xcrun --sdk "$SDK" -f ranlib)"
export CFLAGS="-isysroot \"$SDK\" -arch $ARCH -mios-simulator-version-min=16.0"
export LDFLAGS="-isysroot \"$SDK\" -arch $ARCH -mios-simulator-version-min=16.0"
export MAKE="make CC=$CC AR=$AR RANLIB=$RANLIB"
export CMAKE="cmake -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=$ARCH -DCMAKE_OSX_SYSROOT=\"$SDK\" -DCMAKE_OSX_DEPLOYMENT_TARGET=16.0"
export AUTOCONF_FLAGS="--disable-shared --host=arm-apple-darwin CC=\"$CC\" CXX=\"$CXX\" CPP=\"$CPP\" AR=\"$AR\" RANLIB=\"$RANLIB\" CFLAGS=\"$CFLAGS\" CPPFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\""
export SKIP_EXAMPLES=1
make install
SDK=$(xcrun --sdk iphonesimulator --show-sdk-path) zig build -Dtarget=aarch64-ios-simulator -Dcpu=apple_m1 --release=safe

Note

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.

Copy link

github-actions bot commented Sep 16, 2025
edited
Loading

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copy link
Author

I have read the CLA Document and I hereby sign the CLA

Copy link
Member

@krichprollsch krichprollsch left a 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?

build.zig Outdated
mbedtls.addIncludePath(b.path(root ++ "library"));

mbedtls.addCSourceFiles(.{ .flags = &.{}, .files = &.{
mbedtls.addCSourceFiles(.{ .flags = &.{"-Wno-nullability-completeness"}, .files = &.{
Copy link
Member

@krichprollsch krichprollsch Sep 17, 2025

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?

carson-katri reacted with thumbs up emoji
Copy link
Author

@carson-katri carson-katri Sep 18, 2025

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.

Copy link
Author

carson-katri commented Sep 18, 2025
edited
Loading

I added a zig build static-lib step based on lib.zig. Right now this is empty, but it can include extern definitions. We're building out the API we need for liveview-native this way.

We're going to want this static lib on other platforms too, so I didn't restrict it to iOS.

Copy link
Member

@krichprollsch krichprollsch left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@krichprollsch krichprollsch krichprollsch left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /