forked from YaLTeR/bxt-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
30 lines (25 loc) · 849 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
28
29
30
extern crate gl_generator;
use std::{env, fs::File, path::Path};
use gl_generator::{Api, Fallbacks, Profile, Registry, StructGenerator};
fn main() {
let dest = env::var("OUT_DIR").unwrap();
let mut file = File::create(&Path::new(&dest).join("bindings.rs")).unwrap();
Registry::new(
Api::Gl,
(4, 6), // Extensions below were introduced in OpenGL 4.6.
Profile::Core,
Fallbacks::All,
[
"GL_EXT_memory_object",
"GL_EXT_memory_object_fd",
"GL_EXT_memory_object_win32",
"GL_EXT_semaphore",
"GL_EXT_semaphore_fd",
"GL_EXT_semaphore_win32",
],
)
.write_bindings(StructGenerator, &mut file)
.unwrap();
// Don't re-run the build script on bxt-rs changes.
println!("cargo:rerun-if-changed=build.rs");
}