2025-02-24 15:58:46 -06:00
|
|
|
use system_deps;
|
|
|
|
|
|
|
|
|
|
fn main() {
|
2025-06-25 02:30:42 -05:00
|
|
|
let sources = vec!["key", "mgr", "module", "versekey", "versification"];
|
2025-02-24 15:58:46 -06:00
|
|
|
let deps = system_deps::Config::new().probe().unwrap();
|
|
|
|
|
|
2025-06-25 02:30:42 -05:00
|
|
|
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
|
2025-02-24 15:58:46 -06:00
|
|
|
.includes(deps.all_include_paths())
|
2025-02-24 20:55:06 -06:00
|
|
|
.cpp_link_stdlib("stdc++")
|
|
|
|
|
.flag("-Os")
|
2025-02-24 15:58:46 -06:00
|
|
|
.compile("sword_rs");
|
|
|
|
|
|
2025-02-25 14:55:39 -06:00
|
|
|
println!("cargo:rerun-if-changed=src/cxx/mod.rs");
|
2025-02-24 15:58:46 -06:00
|
|
|
println!("cargo:rustc-link-lib=sword");
|
|
|
|
|
}
|