Trying to hide most of the CXX nastiness behind the actual module Move the CXX ffi stuff to its own module Separate mgr and module mods Modify main.rs to use the basic code we have done so far
18 lines
500 B
Rust
18 lines
500 B
Rust
use system_deps;
|
|
|
|
fn main() {
|
|
let deps = system_deps::Config::new().probe().unwrap();
|
|
|
|
cxx_build::bridge("src/cxx/mod.rs")
|
|
.file("src/cxx/mgr.cc")
|
|
.includes(deps.all_include_paths())
|
|
.cpp_link_stdlib("stdc++")
|
|
.flag("-Os")
|
|
.compile("sword_rs");
|
|
|
|
println!("cargo:rerun-if-changed=src/mgr.rs");
|
|
println!("cargo:rerun-if-changed=src/cxx/mgr.cc");
|
|
println!("cargo:rerun-if-changed=src/cxx/mgr.h");
|
|
println!("cargo:rustc-link-lib=sword");
|
|
}
|