-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.rs
More file actions
28 lines (22 loc) · 767 Bytes
/
build.rs
File metadata and controls
28 lines (22 loc) · 767 Bytes
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
#[cfg(any(target_os = "linux", feature = "enable-glx"))]
extern crate gl_generator;
#[cfg(any(target_os = "linux", feature = "enable-glx"))]
use gl_generator::{Registry, Api, Profile, Fallbacks, GlobalGenerator};
use std::env;
use std::fs::File;
use std::path::{Path, PathBuf};
#[cfg(target_os = "linux")]
fn egl() {
let dest = PathBuf::from(env::var("OUT_DIR").unwrap());
let mut file = File::create(&dest.join("egl_bindings.rs")).unwrap();
Registry::new(Api::Egl,
(1, 4),
Profile::Core,
Fallbacks::All,
[]).write_bindings(gl_generator::StaticGenerator, &mut file).unwrap();
println!("cargo:rustc-link-lib=EGL");
}
fn main() {
#[cfg(target_os = "linux")]
egl();
}