gstreamer-rs/examples/build.rs
Víctor Manuel Jáquez Leal 2778f9c3fb examples: glupload example
2018-12-05 23:03:49 +01:00

25 lines
670 B
Rust

#[cfg(feature = "gl")]
extern crate gl_generator;
#[cfg(feature = "gl")]
fn generate_gl_bindings() {
let dest = std::path::PathBuf::from(&std::env::var("OUT_DIR").unwrap());
let mut file = std::fs::File::create(&dest.join("test_gl_bindings.rs")).unwrap();
gl_generator::Registry::new(
gl_generator::Api::Gles2,
(3, 0),
gl_generator::Profile::Core,
gl_generator::Fallbacks::All,
[],
)
.write_bindings(gl_generator::StructGenerator, &mut file)
.unwrap();
}
#[cfg(not(feature = "gl"))]
fn generate_gl_bindings() {}
fn main() {
println!("cargo:rerun-if-changed=build.rs");
generate_gl_bindings();
}