-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
40 lines (37 loc) · 1.01 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
fn main(){
x11();
}
use std::env;
fn x11(){
if cfg!(feature = "dox") {
return;
}
let deps = [
("gl", "1", "glx"),
("x11", "1.4.99.1", "xlib"),
("x11-xcb", "1.6", "xlib_xcb"),
("xcursor", "1.1", "xcursor"),
("xext", "1.3", "dpms"),
("xft", "2.1", "xft"),
("xi", "1.7", "xinput"),
("xinerama", "1.1", "xinerama"),
("xmu", "1.1", "xmu"),
("xrandr", "1.5", "xrandr"),
("xrender", "0.9.6", "xrender"),
("xpresent", "1", "xpresent"),
("xscrnsaver", "1.2", "xss"),
("xt", "1.1", "xt"),
("xtst", "1.2", "xtst"),
("xxf86vm", "1.1", "xf86vmode"),
];
for &(dep, version, feature) in deps.iter() {
let var = format!("CARGO_FEATURE_{}", feature.to_uppercase().replace('-', "_"));
if env::var_os(var).is_none() {
continue;
}
pkg_config::Config::new()
.atleast_version(version)
.probe(dep)
.unwrap();
}
}