Skip to content

Commit 78a56cc

Browse files
committed
Remove unecessary changes
1 parent 3113ade commit 78a56cc

File tree

5 files changed

+17
-30
lines changed

5 files changed

+17
-30
lines changed

.cargo/config.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ rustflags = [
8888

8989
[target.aarch64-apple-watchos]
9090
rustflags = [
91-
"-C", "link-arg=-mwatchos-version-min=7.0",
91+
"-C", "link-arg=-mwatchos-version-min=9.0",
9292
]
9393

9494
[target.aarch64-apple-watchos-sim]
9595
rustflags = [
96-
"-C", "link-arg=-mwatchsimulator-version-min=7.0",
96+
"-C", "link-arg=-mwatchsimulator-version-min=9.0",
9797
]
9898

9999
[target.x86_64-apple-watchos-sim]
100100
rustflags = [
101-
"-C", "link-arg=-mwatchos-version-min=7.0",
101+
"-C", "link-arg=-mwatchos-version-min=9.0",
102102
]

crates/shell/build.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
12
fn main() {
23
let mut cfg = cc::Build::new();
3-
let target = std::env::var("TARGET").unwrap();
4-
let is_watchos = target.contains("watchos") || target.contains("watchsimulator");
54

65
// Compile the SQLite source
76
cfg.file("../sqlite/sqlite/sqlite3.c");
7+
cfg.file("../sqlite/sqlite/shell.c");
88
cfg.include("../sqlite/sqlite");
99

1010
// General SQLite options
@@ -14,22 +14,15 @@ fn main() {
1414
// Call core_init() in main.rs
1515
cfg.define("SQLITE_EXTRA_INIT", Some("core_init"));
1616

17-
if is_watchos {
18-
// For watchOS, don't build the shell and disable readline
19-
cfg.define("HAVE_READLINE", Some("0"));
20-
cfg.define("HAVE_EDITLINE", Some("0"));
21-
cfg.define("SQLITE_OMIT_SYSTEM", Some("1"));
22-
} else {
23-
// For other platforms, build the shell with readline
24-
cfg.file("../sqlite/sqlite/shell.c");
25-
cfg.define("HAVE_READLINE", Some("1"));
26-
println!("cargo:rustc-link-lib=readline");
27-
}
17+
// Compile with readline support (also requires -lreadline / cargo:rustc-link-lib=readline below)
18+
cfg.define("HAVE_READLINE", Some("1"));
2819

2920
// Silence warnings generated for SQLite
3021
cfg.flag("-Wno-implicit-fallthrough");
3122
cfg.flag("-Wno-unused-parameter");
3223
cfg.flag("-Wno-null-pointer-subtraction");
3324

3425
cfg.compile("sqlite-ps");
26+
27+
println!("cargo:rustc-link-lib=readline");
3528
}

crates/shell/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ fn panic(_info: &core::panic::PanicInfo) -> ! {
2828
#[lang = "eh_personality"]
2929
extern "C" fn eh_personality() {}
3030

31+
3132
#[no_mangle]
3233
pub extern "C" fn core_init(_dummy: *mut c_char) -> c_int {
3334
powersync_init_static()

crates/sqlite/build.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
fn main() {
22
let mut cfg = cc::Build::new();
3-
let target = std::env::var("TARGET").unwrap();
4-
let is_watchos = target.contains("watchos") || target.contains("watchsimulator");
53

64
// Compile the SQLite source
75
cfg.file("./sqlite/sqlite3.c");
6+
cfg.file("./sqlite/shell.c");
87
cfg.include("./sqlite");
98

109
// General SQLite options
1110
cfg.define("SQLITE_THREADSAFE", Some("0"));
1211
cfg.define("SQLITE_ENABLE_BYTECODE_VTAB", Some("1"));
1312

14-
if is_watchos {
15-
// For watchOS, don't build the shell and disable readline
16-
cfg.define("HAVE_READLINE", Some("0"));
17-
cfg.define("HAVE_EDITLINE", Some("0"));
18-
cfg.define("SQLITE_OMIT_SYSTEM", Some("1"));
19-
} else {
20-
// For other platforms, build the shell with readline
21-
cfg.file("./sqlite/shell.c");
22-
cfg.define("HAVE_READLINE", Some("1"));
23-
println!("cargo:rustc-link-lib=readline");
24-
}
13+
// Compile with readline support (also requires -lreadline / cargo:rustc-link-lib=readline below)
14+
cfg.define("HAVE_READLINE", Some("1"));
2515

2616
// Silence warnings generated for SQLite
2717
cfg.flag("-Wno-implicit-fallthrough");
2818
cfg.flag("-Wno-unused-parameter");
2919
cfg.flag("-Wno-null-pointer-subtraction");
3020

3121
cfg.compile("sqlite");
22+
23+
println!("cargo:rustc-link-lib=readline");
3224
}

tool/build_xcframework.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ function createXcframework() {
137137
-framework "${BUILD_DIR}/watchos-arm64_x86_64-simulator/powersync-sqlite-core.framework" \
138138
-output "${BUILD_DIR}/powersync-sqlite-core.xcframework"
139139

140+
cp -Rf "${BUILD_DIR}/powersync-sqlite-core.xcframework" "powersync-sqlite-core.xcframework"
140141
zip -r --symlinks powersync-sqlite-core.xcframework.zip powersync-sqlite-core.xcframework LICENSE README.md
141142
rm -rf ${BUILD_DIR}
142143
}
@@ -148,7 +149,7 @@ rm -rf powersync-sqlite-core.xcframework
148149

149150
for TARGET in ${TARGETS[@]}; do
150151
echo "Building PowerSync loadable extension for $TARGET"
151-
#cargo build -p powersync_loadable --profile release_apple --target $TARGET -Zbuild-std
152+
cargo build -p powersync_loadable --profile release_apple --target $TARGET -Zbuild-std
152153
done
153154

154155
createXcframework

0 commit comments

Comments
 (0)