blob: 8c883f48d162ba71395786d6b3e31702d45aa301 (
plain)
| 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
28
 | extern crate cbindgen;
use std::env;
use cbindgen::Language;
fn main() {
    let crate_dir = env!("CARGO_MANIFEST_DIR");
    let config = cbindgen::Config::from_file("cbindgen.toml")
        .expect("Failed to read 'cbindgen.toml'");
    cbindgen::Builder::new()
        .with_crate(crate_dir)
        // .with_language(Language::C)
        .with_config(config)
        .generate()
        .expect("Unable to generate bindings")
        .write_to_file("dome_key_map.h");
    // Link libdome_key_event_source_simulator.a
    println!("cargo:rustc-link-lib=static=dome_key_event_source_simulator");
    println!(
        "cargo:rustc-link-search=native=./target/{profile}/deps",
        profile=env::var("PROFILE").unwrap(),
    );
}
 |