Try fix some build/publish issues.
This commit is contained in:
@@ -41,3 +41,4 @@ strip = "symbols"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
sitk_no_build = [] # do not build all the C++ stuff, just use the rust code to make docs etc.
|
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
|
||||||
|
|||||||
3
build.rs
3
build.rs
@@ -74,10 +74,11 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
cpp_string.replace_all(&cxx, "pub mod simple {\nuse crate::ffi::ToCppString;");
|
cpp_string.replace_all(&cxx, "pub mod simple {\nuse crate::ffi::ToCppString;");
|
||||||
write!(f, "{}", cxx)?;
|
write!(f, "{}", cxx)?;
|
||||||
}
|
}
|
||||||
|
if cfg!(feature = "copy_autocxx_src") {
|
||||||
fs::copy(dst.join(&cxx_file), "src/autocxx-ffi-default-gen_unfmt.rs")?;
|
fs::copy(dst.join(&cxx_file), "src/autocxx-ffi-default-gen_unfmt.rs")?;
|
||||||
Command::new("rustfmt").arg(&cxx_file).status()?;
|
Command::new("rustfmt").arg(&cxx_file).status()?;
|
||||||
fs::copy(dst.join(&cxx_file), "src/autocxx-ffi-default-gen.rs")?;
|
fs::copy(dst.join(&cxx_file), "src/autocxx-ffi-default-gen.rs")?;
|
||||||
|
}
|
||||||
println!("cargo:warning=merged_lib={}", merged_lib.join("build").display());
|
println!("cargo:warning=merged_lib={}", merged_lib.join("build").display());
|
||||||
println!("cargo:rustc-link-search={}", merged_lib.join("build").display());
|
println!("cargo:rustc-link-search={}", merged_lib.join("build").display());
|
||||||
println!("cargo:rustc-link-lib=static=sitk_ffi_extra");
|
println!("cargo:rustc-link-lib=static=sitk_ffi_extra");
|
||||||
|
|||||||
Reference in New Issue
Block a user