build.rs: re-run autocxx if any ffi module changed

I'm not 100% sure this is the right thing but it seems to fix a scenario
where a change to a Rust module was not propagated by "make".
This commit is contained in:
Johannes Altmanninger 2023-02-03 07:56:32 +01:00
parent a502cb16c3
commit 44d75409d0

View file

@ -26,7 +26,7 @@ fn main() -> miette::Result<()> {
"src/topic_monitor.rs",
"src/builtins/shared.rs",
];
cxx_build::bridges(source_files)
cxx_build::bridges(&source_files)
.flag_if_supported("-std=c++11")
.include(&fish_src_dir)
.include(&fish_build_dir) // For config.h
@ -41,7 +41,9 @@ fn main() -> miette::Result<()> {
.build()?;
b.flag_if_supported("-std=c++11")
.compile("fish-rust-autocxx");
println!("cargo:rerun-if-changed=src/ffi.rs");
for file in source_files {
println!("cargo:rerun-if-changed={file}");
}
Ok(())
}