diff --git a/build.rs b/build.rs index a137ce7..8db1012 100644 --- a/build.rs +++ b/build.rs @@ -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() + ); + 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)