1 // x11-rs: Rust bindings for X11 libraries
2 // The X11 libraries are available under the MIT license.
3 // These bindings are public domain.
4
5 extern crate pkg_config;
6
7 use std::env;
8
main()9 fn main () {
10 if cfg!(feature = "dox") { return; }
11
12 let deps = [
13 ("gl", "1", "glx"),
14 ("x11", "1.4.99.1", "xlib"),
15 ("x11-xcb", "1.6", "xlib_xcb"),
16 ("xcursor", "1.1", "xcursor"),
17 ("xext", "1.3", "dpms"),
18 ("xft", "2.1", "xft"),
19 ("xi", "1.7", "xinput"),
20 ("xinerama", "1.1", "xinerama"),
21 ("xmu", "1.1", "xmu"),
22 ("xrandr", "1.5", "xrandr"),
23 ("xrender", "0.9.6", "xrender"),
24 ("xscrnsaver", "1.2", "xss"),
25 ("xt", "1.1", "xt"),
26 ("xtst", "1.2", "xtst"),
27 ("xxf86vm", "1.1", "xf86vmode"),
28 ];
29
30 for &(dep, version, feature) in deps.iter() {
31 let var = format!(
32 "CARGO_FEATURE_{}",
33 feature.to_uppercase().replace('-', "_")
34 );
35 if env::var_os(var).is_none() { continue; }
36 pkg_config::Config::new().atleast_version(version).probe(dep).unwrap();
37 }
38 }
39