Skip to content

Commit

Permalink
Merge pull request #576 from pjhades/sys-fix-build-script
Browse files Browse the repository at this point in the history
libsql-sys: fix path to sqlite3.c in build.rs
  • Loading branch information
LucioFranco authored Nov 7, 2023
2 parents ecf6dbb + 81ab906 commit 5292eff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libsql-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ fn main() {
}

pub fn build_bundled(out_dir: &str, out_path: &Path) {
let bindings_dir = if std::env::var("LIBSQL_REGENERATE_BINDINGS").is_ok() {
if std::env::var("LIBSQL_REGENERATE_BINDINGS").is_ok() {
let header = HeaderLocation::FromPath(format!("bundled/src/sqlite3.h"));
bindings::write_to_out_dir(header, out_path);
out_path.display().to_string()
} else {
let bindgen_rs_path = if cfg!(feature = "session") {
"bundled/bindings/session_bindgen.rs"
Expand All @@ -25,9 +24,9 @@ pub fn build_bundled(out_dir: &str, out_path: &Path) {
};
let dir = env!("CARGO_MANIFEST_DIR");
std::fs::copy(format!("{dir}/{bindgen_rs_path}"), out_path).unwrap();
"bundled/src".to_string()
};
}

let bindings_dir = "bundled/src".to_string();
println!("cargo:rerun-if-changed={bindings_dir}/sqlite3.c");
let mut cfg = cc::Build::new();
cfg.file(format!("{bindings_dir}/sqlite3.c"))
Expand Down

0 comments on commit 5292eff

Please sign in to comment.