mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-14 02:43:19 +03:00
24 lines
733 B
Rust
24 lines
733 B
Rust
use std::{env, path::PathBuf};
|
|
|
|
fn main() {
|
|
generate_dispatch_bindings();
|
|
}
|
|
|
|
fn generate_dispatch_bindings() {
|
|
println!("cargo:rustc-link-lib=framework=System");
|
|
println!("cargo:rerun-if-changed=src/platform/mac/dispatch.h");
|
|
|
|
let bindings = bindgen::Builder::default()
|
|
.header("src/platform/mac/dispatch.h")
|
|
.whitelist_var("_dispatch_main_q")
|
|
.whitelist_function("dispatch_async_f")
|
|
.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("dispatch_sys.rs"))
|
|
.expect("couldn't write bindings");
|
|
}
|