Skip to content

feat: add watchOS support (tentative) #73

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 2 commits into
base: main
Choose a base branch
from

Conversation

zifeo
Copy link

@zifeo zifeo commented May 11, 2025

Not a watchOS expert, so carefully review and guidance required.

Copy link
Contributor

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for getting started on this!

fn main() {
let mut cfg = cc::Build::new();
let target = std::env::var("TARGET").unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we building crates/shell and crates/sqlite for watchOS somewhere? These are mostly used for testing and development, IIRC we don't ship them for iOS either. So I wonder if the changes are necessary.

Comment on lines +58 to +61
<key>CFBundleVersion</key>
<string>0.3.12</string>
<key>CFBundleShortVersionString</key>
<string>0.3.12</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could extract the common prefix of those files into a shared variable, e.g. this one uses 0.3.12 while our other builds are at 0.3.14. Keeping those in sync would be easier that way.


cp -Rf "${BUILD_DIR}/powersync-sqlite-core.xcframework" "powersync-sqlite-core.xcframework"
zip -r --symlinks powersync-sqlite-core.xcframework.zip powersync-sqlite-core.xcframework LICENSE README.md
zip -r --symlinks powersync-sqlite-core.xcframework.zip powersync-sqlite-core.xcframework "${BUILD_DIR}/watchos-arm64/powersync-sqlite-core.framework/libpowersync.a" "${BUILD_DIR}/watchos-arm64-simulator/powersync-sqlite-core.framework/libpowersync.a" LICENSE README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not a watchOS expert, but is there a reason for requiring static libraries here? Why would the regular framework not work?


function createXcframework() {
plist=$(cat << EOF
ios_plist=$(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's technically not just ios, we're using this for macOS too. I don't know what a better name would be either though, maybe common_plist?

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

Successfully merging this pull request may close these issues.

2 participants