2024-03-01 05:45:51 +00:00
|
|
|
use std::env;
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("cargo:rustc-link-lib=vulkan");
|
|
|
|
println!("cargo:rustc-link-lib=glfw");
|
|
|
|
|
|
|
|
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
|
|
|
|
2024-03-04 03:07:33 +00:00
|
|
|
let glfw_vk_bindings = bindgen::Builder::default()
|
2024-03-01 05:45:51 +00:00
|
|
|
.header_contents("glfw_defines", "#define GLFW_INCLUDE_VULKAN")
|
|
|
|
.header("/usr/include/GLFW/glfw3.h")
|
|
|
|
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
|
|
|
|
.generate()
|
|
|
|
.expect("Unable to generate glfw bindings");
|
|
|
|
|
2024-03-04 03:07:33 +00:00
|
|
|
glfw_vk_bindings
|
|
|
|
.write_to_file(out_path.join("glfw_vk_bindings.rs"))
|
2024-03-01 05:45:51 +00:00
|
|
|
.expect("Couldn't write glfw bindings!");
|
|
|
|
}
|