1
0

feat: add rust binding framework

This commit is contained in:
2026-02-05 17:18:48 +08:00
parent 6d41e593bc
commit 8bc0792f1e
9 changed files with 127 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
use std::env;
use std::path::PathBuf;
fn main() {
// Fetch user specified install directory of built BMap.
let install_dir = env::var("LibCmo_ROOT").expect("You must set LibCmo_ROOT to the install directory of LibCmo built by CMake before building this Rust crate.");
let install_path = PathBuf::from(install_dir);
// Tell Rust compiler where to find linkd dynamic library.
println!("cargo:rustc-link-search=native={}", install_path.join("lib").display());
// Tell Rust compiler the name of linked dynamic library.
println!("cargo:rustc-link-lib=dylib=BMap");
}