1+
12fn 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}
0 commit comments