Skip to content

Commit

Permalink
cxx: fix build with CARGO_TARGET_DIR set
Browse files Browse the repository at this point in the history
  • Loading branch information
fw-immunant committed Jan 16, 2025
1 parent c04d286 commit bd8d070
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion third_party/cxx/blobstore/build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
fn main() {
// Find target directory, either from CARGO_TARGET_DIR or in-tree if unset.
let mut src_dir = std::env::var_os("CARGO_TARGET_DIR").unwrap_or("../../../target".into());
src_dir.push("/cxxbridge/demo/src");

cxx_build::bridge("src/main.rs")
.file("src/blobstore.cc")
.flag_if_supported("-std=c++14")
.include(".")
.include("../../../target/cxxbridge/demo/src")
.include(src_dir)
.compile("cxxbridge-demo");

println!("cargo:rerun-if-changed=src/main.rs");
Expand Down

0 comments on commit bd8d070

Please sign in to comment.