1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/rust/config/build.rs
David Mulder 35b34e8e42 Add build config for proper TDB build linkage
The tdb build needs to know whether Samba is
building with TDB bundled or not, otherwise
linking will fail.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2024-10-23 14:21:33 +00:00

21 lines
621 B
Rust

use std::env;
use std::path::PathBuf;
fn main() {
let header = "../../bin/default/include/config.h";
println!("cargo:rerun-if-changed={}", header);
let additions_header = "./additions.h";
println!("cargo:rerun-if-changed={}", additions_header);
let bindings = bindgen::Builder::default()
.header(additions_header)
.header(header)
.generate()
.expect("Failed generating config bindings!");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}