From fbc09a76f9dcbc727ed4b4e78ce3021ed50688d8 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Thu, 17 Nov 2016 09:55:33 -0500 Subject: [PATCH] Make the with_egl dependency more precise so libEGL is not needed unless the feature is enabled --- Cargo.toml | 2 +- build.rs | 2 +- src/platform/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2605d68..63d5498 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "offscreen_gl_context" license = "MIT / Apache-2.0" -version = "0.4.5" +version = "0.5.0" authors = ["Emilio Cobos Álvarez ", "The Servo Project Developers"] description = "Creation and manipulation of HW accelerated offscreen rendering contexts in multiple platforms. Originally intended for the Servo project's WebGL implementation." repository = "https://github.com/emilio/rust-offscreen-rendering-context" diff --git a/build.rs b/build.rs index 5f14f4b..606ecf3 100644 --- a/build.rs +++ b/build.rs @@ -15,7 +15,7 @@ fn main() { .write_bindings(gl_generator::StaticGenerator, &mut file).unwrap(); } - if target.contains("android") || target.contains("linux") { + if target.contains("android") || (target.contains("linux") && cfg!(feature = "test_egl_in_linux")) { 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(); diff --git a/src/platform/mod.rs b/src/platform/mod.rs index 8fa6a90..a0f6c14 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -36,7 +36,7 @@ pub mod with_osmesa; #[cfg(feature="osmesa")] pub use self::with_osmesa::{OSMesaContext, OSMesaContextHandle}; -#[cfg(any(target_os="android", target_os="linux"))] +#[cfg(any(target_os="android", all(target_os="linux", feature = "test_egl_in_linux")))] pub mod with_egl; #[cfg(target_os="android")] pub use self::with_egl::{NativeGLContext, NativeGLContextHandle};