-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.rs
27 lines (21 loc) · 839 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use std::env;
use std::path::PathBuf;
fn main() {
println!("cargo:rustc-link-search=native=LibreHardwareMonitorAPI\\x64\\Release");
println!("cargo:rustc-link-lib=dylib=ManagedLibreHardwareMonitorWrapper");
let bindings = bindgen::Builder::default()
.header("bindings.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.expect("Unable to generate 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!");
// forces app to run as admin
embed_resource::compile("program.rc", embed_resource::NONE);
winres::WindowsResource::new()
.set_icon("icon.ico")
.compile()
.expect("failed to add icon to executable");
}