diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-08-30 14:35:47 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-08-30 14:35:47 +0200 |
commit | 9d6d2412c7fc7c26574e91a8dc981eaecaa49542 (patch) | |
tree | bd9b70c965bd0edbf2a96c1be7ecc4c440488c87 | |
parent | b8b1b80631e1335a7ab747f34e1c67dfa0790a10 (diff) | |
parent | b707959c2c0ae97c2225c2e6dbc07fc754125458 (diff) | |
download | glutin-9d6d2412c7fc7c26574e91a8dc981eaecaa49542.tar.gz glutin-9d6d2412c7fc7c26574e91a8dc981eaecaa49542.zip |
Merge pull request #589 from mneumann/dragonfly2
Make it work on DragonFly/FreeBSD
-rw-r--r-- | Cargo.toml | 14 | ||||
-rw-r--r-- | build.rs | 2 | ||||
-rw-r--r-- | src/api/dlopen.rs | 2 | ||||
-rw-r--r-- | src/api/egl/ffi.rs | 2 | ||||
-rw-r--r-- | src/api/egl/mod.rs | 3 | ||||
-rw-r--r-- | src/api/glx/mod.rs | 2 | ||||
-rw-r--r-- | src/api/osmesa/mod.rs | 2 | ||||
-rw-r--r-- | src/api/wayland/mod.rs | 2 | ||||
-rw-r--r-- | src/api/x11/mod.rs | 2 | ||||
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | src/platform/linux/mod.rs | 2 | ||||
-rw-r--r-- | src/platform/mod.rs | 6 |
12 files changed, 30 insertions, 11 deletions
@@ -108,3 +108,17 @@ wayland-client = { version = "0.2.1", features = ["egl", "dlopen"] } wayland-kbd = "0.2.0" wayland-window = "0.1.0" x11-dl = "~2.0" + +[target.x86_64-unknown-dragonfly.dependencies] +osmesa-sys = "0.0.5" +wayland-client = { version = "0.2.1", features = ["egl", "dlopen"] } +wayland-kbd = "0.2.0" +wayland-window = "0.1.0" +x11-dl = "~2.0" + +[target.x86_64-unknown-freebsd.dependencies] +osmesa-sys = "0.0.5" +wayland-client = { version = "0.2.1", features = ["egl", "dlopen"] } +wayland-kbd = "0.2.0" +wayland-window = "0.1.0" +x11-dl = "~2.0" @@ -59,7 +59,7 @@ fn main() { "1.5", "core", &mut file).unwrap(); } - if target.contains("linux") { + if target.contains("linux") || target.contains("dragonfly") || target.contains("freebsd") { let mut file = File::create(&dest.join("glx_bindings.rs")).unwrap(); gl_generator::generate_bindings(gl_generator::StructGenerator, gl_generator::registry::Ns::Glx, diff --git a/src/api/dlopen.rs b/src/api/dlopen.rs index 945dfb0..1bb2a0a 100644 --- a/src/api/dlopen.rs +++ b/src/api/dlopen.rs @@ -1,4 +1,4 @@ -#![cfg(target_os = "linux")] +#![cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))] #![allow(dead_code)] use libc; diff --git a/src/api/egl/ffi.rs b/src/api/egl/ffi.rs index 6a81ada..ae02e30 100644 --- a/src/api/egl/ffi.rs +++ b/src/api/egl/ffi.rs @@ -33,3 +33,5 @@ pub type EGLNativeWindowType = winapi::HWND; pub type EGLNativeWindowType = *const libc::c_void; #[cfg(target_os = "android")] pub type EGLNativeWindowType = *const libc::c_void; +#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] +pub type EGLNativeWindowType = *const libc::c_void; diff --git a/src/api/egl/mod.rs b/src/api/egl/mod.rs index 32902e5..4cd7a7c 100644 --- a/src/api/egl/mod.rs +++ b/src/api/egl/mod.rs @@ -1,4 +1,5 @@ -#![cfg(any(target_os = "windows", target_os = "linux", target_os = "android"))] +#![cfg(any(target_os = "windows", target_os = "linux", target_os = "android", + target_os = "dragonfly", target_os = "freebsd"))] #![allow(unused_variables)] use BuilderAttribs; diff --git a/src/api/glx/mod.rs b/src/api/glx/mod.rs index 72bdf03..0b2cf9f 100644 --- a/src/api/glx/mod.rs +++ b/src/api/glx/mod.rs @@ -1,4 +1,4 @@ -#![cfg(all(target_os = "linux", feature = "window"))] +#![cfg(all(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"), feature = "window"))] use BuilderAttribs; use ContextError; diff --git a/src/api/osmesa/mod.rs b/src/api/osmesa/mod.rs index 056e2d1..9bd24b6 100644 --- a/src/api/osmesa/mod.rs +++ b/src/api/osmesa/mod.rs @@ -1,4 +1,4 @@ -#![cfg(any(target_os = "linux", target_os = "freebsd"))] +#![cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly"))] extern crate osmesa_sys; diff --git a/src/api/wayland/mod.rs b/src/api/wayland/mod.rs index 0381f31..b46e2d1 100644 --- a/src/api/wayland/mod.rs +++ b/src/api/wayland/mod.rs @@ -1,4 +1,4 @@ -#![cfg(target_os = "linux")] +#![cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))] #![allow(unused_variables, dead_code)] use self::wayland::egl::{EGLSurface, is_egl_available}; diff --git a/src/api/x11/mod.rs b/src/api/x11/mod.rs index 1ba6bc7..39b99f3 100644 --- a/src/api/x11/mod.rs +++ b/src/api/x11/mod.rs @@ -1,4 +1,4 @@ -#![cfg(all(target_os = "linux", feature = "window"))] +#![cfg(all(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"), feature = "window"))] pub use self::monitor::{MonitorID, get_available_monitors, get_primary_monitor}; pub use self::window::{Window, XWindow, PollEventsIterator, WaitEventsIterator, Context, WindowProxy}; @@ -55,7 +55,7 @@ extern crate cocoa; extern crate core_foundation; #[cfg(target_os = "macos")] extern crate core_graphics; -#[cfg(any(target_os = "linux", target_os = "freebsd"))] +#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly"))] extern crate x11_dl; pub use events::*; diff --git a/src/platform/linux/mod.rs b/src/platform/linux/mod.rs index fc42f18..3525ce5 100644 --- a/src/platform/linux/mod.rs +++ b/src/platform/linux/mod.rs @@ -1,4 +1,4 @@ -#![cfg(target_os = "linux")] +#![cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))] use Api; use BuilderAttribs; diff --git a/src/platform/mod.rs b/src/platform/mod.rs index c4b2265..4855765 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -3,7 +3,7 @@ pub use self::platform::*; #[cfg(target_os = "windows")] #[path="windows/mod.rs"] mod platform; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))] #[path="linux/mod.rs"] mod platform; #[cfg(target_os = "macos")] @@ -16,5 +16,7 @@ mod platform; #[path="ios/mod.rs"] mod platform; -#[cfg(all(not(target_os = "ios"), not(target_os = "windows"), not(target_os = "linux"), not(target_os = "macos"), not(target_os = "android")))] +#[cfg(all(not(target_os = "ios"), not(target_os = "windows"), not(target_os = "linux"), + not(target_os = "macos"), not(target_os = "android"), not(target_os = "dragonfly"), + not(target_os = "freebsd")))] use this_platform_is_not_supported; |