Skip to content

Commit 7629d56

Browse files
committed
Also build for tvOS and watchOS
1 parent 142008f commit 7629d56

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

crates/static/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ features = []
2222

2323
[features]
2424
nightly = []
25-
default = ["powersync_core/static"]
25+
# Whether to expect SQLite to be linked statically as well.
26+
static = ["powersync_core/static"]

tool/build_macos.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,32 @@ function compile() {
1212
mv "target/$triple/release/libpowersync.a" "libpowersync_$suffix.$os.a"
1313
}
1414

15+
function compile_static() {
16+
local triple=$1
17+
local suffix=$2
18+
local os=$3
19+
20+
cargo build -p powersync_static -Z build-std=panic_abort,core,alloc --features nightly --release --target $triple
21+
22+
mv "target/$triple/release/libpowersync.a" "libpowersync_$suffix.$os.a"
23+
}
24+
1525
case "$1" in
1626
x64)
1727
compile x86_64-apple-darwin x64 macos
1828
compile x86_64-apple-ios x64 ios-sim
29+
compile x86_64-apple-tvos x64 tvos-sim
30+
compile_static x86_64-apple-watchos-sim x64 watchos-sim
1931
;;
2032
aarch64)
2133
compile aarch64-apple-darwin aarch64 macos
2234
compile aarch64-apple-ios-sim aarch64 ios-sim
2335
compile aarch64-apple-ios aarch64 ios
36+
compile aarch64-apple-tvos aarch64 tvos
37+
compile aarch64-apple-tvos-sim aarch64 tvos-sim
38+
compile_static aarch64-apple-watchos aarch64 watchos
39+
compile_static aarch64-apple-watchos aarch64 watchos-sim
40+
compile_static arm64_32-apple-watchos arm64_32 watchos
2441
;;
2542
*)
2643
echo "Unknown architecture"

tool/build_xcframework.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ for TARGET in ${TARGETS[@]}; do
187187
cargo build \
188188
-p powersync_static \
189189
--profile release_apple \
190-
--features nightly \
190+
--features static,nightly \
191191
--target $TARGET \
192192
-Zbuild-std
193193
else

0 commit comments

Comments
 (0)