Try fix some build/publish issues.

This commit is contained in:
Wim Pomp
2025-09-12 19:04:25 +02:00
parent d56f3155ad
commit 569423b922
2 changed files with 6 additions and 4 deletions

View File

@@ -41,3 +41,4 @@ strip = "symbols"
[features]
sitk_no_build = [] # do not build all the C++ stuff, just use the rust code to make docs etc.
copy_autocxx_src = [] # copy the generated autocxx-ffi-default-gen.rs to src for inclusion in the repo

View File

@@ -74,10 +74,11 @@ fn main() -> Result<(), Box<dyn Error>> {
cpp_string.replace_all(&cxx, "pub mod simple {\nuse crate::ffi::ToCppString;");
write!(f, "{}", cxx)?;
}
if cfg!(feature = "copy_autocxx_src") {
fs::copy(dst.join(&cxx_file), "src/autocxx-ffi-default-gen_unfmt.rs")?;
Command::new("rustfmt").arg(&cxx_file).status()?;
fs::copy(dst.join(&cxx_file), "src/autocxx-ffi-default-gen.rs")?;
}
println!("cargo:warning=merged_lib={}", merged_lib.join("build").display());
println!("cargo:rustc-link-search={}", merged_lib.join("build").display());
println!("cargo:rustc-link-lib=static=sitk_ffi_extra");