Files
sword_rs/build.rs
T
2025-06-29 22:04:56 -05:00

22 lines
668 B
Rust

use system_deps;
fn main() {
let sources = vec!["mgr", "module", "versekey", "versification"];
let deps = system_deps::Config::new().probe().unwrap();
let mut build = cxx_build::bridge("src/cxx/mod.rs");
for src in sources {
build.file(&format!("src/cxx/{}.cc", src));
println!("cargo:rerun-if-changed=src/cxx/{}.cc", src);
println!("cargo:rerun-if-changed=src/cxx/{}.h", src);
}
build
.includes(deps.all_include_paths())
.cpp_link_stdlib("stdc++")
.flag("-Os")
.compile("sword_rs");
println!("cargo:rerun-if-changed=src/cxx/mod.rs");
println!("cargo:rustc-link-lib=sword");
}