From fe1ae0b7eb2d1a25220bc58cd7dfbbed8e9d7772 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 20 Feb 2018 14:10:55 -0800 Subject: [PATCH] Be more particular about platform deps --- Cargo.toml | 2 +- src/main.rs | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c55b918e7..847835ee7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ mio = "0.6.12" palette = "0.2.1" serde = "1.0.27" serde_derive = "1.0.27" -servo-fontconfig = "0.4.0" toml = "0.4.5" unicode-width = "0.1.4" @@ -30,6 +29,7 @@ path = "term" [target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies] freetype = "0.3" +servo-fontconfig = "0.4.0" [target.'cfg(all(unix, not(target_os = "macos")))'.dependencies.x11] features = ["xlib"] diff --git a/src/main.rs b/src/main.rs index 547d31059..62734e948 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,9 +7,9 @@ extern crate euclid; extern crate glium; extern crate unicode_width; extern crate harfbuzz; -#[cfg(not(target_os = "macos"))] +#[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))] extern crate fontconfig; // from servo-fontconfig -#[cfg(not(target_os = "macos"))] +#[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))] extern crate freetype; extern crate libc; extern crate mio; @@ -19,13 +19,16 @@ extern crate serde_derive; extern crate palette; extern crate term; extern crate toml; +#[cfg(all(unix, not(target_os = "macos")))] extern crate x11; #[macro_use] pub mod log; use failure::Error; +#[cfg(all(unix, not(target_os = "macos")))] extern crate xcb; +#[cfg(all(unix, not(target_os = "macos")))] extern crate xcb_util; use mio::{Events, Poll, PollOpt, Ready, Token}; @@ -38,15 +41,22 @@ use std::str; use std::time::Duration; mod config; + +#[cfg(all(unix, not(target_os = "macos")))] mod xgfx; +#[cfg(all(unix, not(target_os = "macos")))] mod xkeysyms; + mod font; use font::{FontConfiguration, ftwrap}; mod pty; mod sigchld; mod textureatlas; + +#[cfg(all(unix, not(target_os = "macos")))] mod xwin; +#[cfg(all(unix, not(target_os = "macos")))] use xwin::TerminalWindow; /// Determine which shell to run.