smithay/build.rs

47 lines
1.3 KiB
Rust
Raw Normal View History

2017-05-18 20:28:02 +00:00
extern crate gl_generator;
2017-05-21 20:40:15 +00:00
use gl_generator::{Api, Fallbacks, Profile, Registry};
2017-05-18 20:28:02 +00:00
use std::env;
use std::fs::File;
use std::path::PathBuf;
fn main() {
let dest = PathBuf::from(&env::var("OUT_DIR").unwrap());
println!("cargo:rerun-if-changed=build.rs");
let mut file = File::create(&dest.join("egl_bindings.rs")).unwrap();
2017-06-20 09:31:18 +00:00
Registry::new(
Api::Egl,
(1, 5),
Profile::Core,
Fallbacks::All,
[
"EGL_KHR_create_context",
"EGL_EXT_create_context_robustness",
"EGL_KHR_create_context_no_error",
"EGL_KHR_platform_x11",
"EGL_KHR_platform_android",
"EGL_KHR_platform_wayland",
"EGL_KHR_platform_gbm",
"EGL_EXT_platform_base",
"EGL_EXT_platform_x11",
"EGL_MESA_platform_gbm",
"EGL_EXT_platform_wayland",
"EGL_EXT_platform_device",
2017-12-09 16:32:22 +00:00
"EGL_KHR_image_base",
2017-06-20 09:31:18 +00:00
],
2017-12-09 16:32:22 +00:00
).write_bindings(gl_generator::GlobalGenerator, &mut file)
2018-09-24 22:32:09 +00:00
.unwrap();
2017-12-10 21:09:17 +00:00
let mut file = File::create(&dest.join("gl_bindings.rs")).unwrap();
Registry::new(
Api::Gles2,
(3, 2),
Profile::Compatibility,
Fallbacks::None,
2018-01-07 21:30:38 +00:00
["GL_OES_EGL_image"],
2017-12-10 21:09:17 +00:00
).write_bindings(gl_generator::GlobalGenerator, &mut file)
2018-09-24 22:32:09 +00:00
.unwrap();
2017-05-18 20:28:02 +00:00
}