Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Trigger rebuild on changes #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
use std::path::PathBuf;

fn main() {
let datasketches = PathBuf::from("datasketches-cpp");
let src = PathBuf::from("src");
let mut bridge = cxx_build::bridge(src.join("bridge.rs"));
let datasketches_src = PathBuf::from("datasketches-cpp");
let rust_src = PathBuf::from("src");

let mut bridge = cxx_build::bridge(rust_src.join("bridge.rs"));

println!(
"cargo:rerun-if-changed={}",
rust_src.join("bridge.rs").to_str().unwrap()
);
println!(
"cargo:rerun-if-changed={}",
datasketches_src.join("cpc.cpp").to_str().unwrap()
);
println!(
"cargo:rerun-if-changed={}",
datasketches_src.join("theta.cp").to_str().unwrap()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theta.cpp?

);
println!(
"cargo:rerun-if-changed={}",
datasketches_src.join("hh.cpp").to_str().unwrap()
);

assert!(bridge.is_flag_supported("-std=c++11").expect("supported"));
bridge
.files(&[
datasketches.join("cpc.cpp"),
datasketches.join("theta.cpp"),
datasketches.join("hh.cpp"),
datasketches_src.join("cpc.cpp"),
datasketches_src.join("theta.cpp"),
datasketches_src.join("hh.cpp"),
])
.include(datasketches.join("common").join("include"))
.include(datasketches_src.join("common").join("include"))
.flag_if_supported("-std=c++11")
.cpp_link_stdlib("stdc++")
.static_flag(true)
Expand Down