Skip to content

Commit a2e2a01

Browse files
committed
feature: allow static builds
1 parent d03b95f commit a2e2a01

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

x11/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ xtest = ["xtst"]
5454
xtst = []
5555
dox = []
5656

57+
# Enable static linking of X11 dependencies.
58+
static = []
59+
5760
[dependencies]
5861
libc = "0.2"
5962

x11/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ fn main() {
3131
("xxf86vm", "1.1", "xf86vmode"),
3232
];
3333

34+
let statik = env::var_os("CARGO_FEATURE_STATIC").is_none();
35+
3436
for &(dep, version, feature) in deps.iter() {
3537
let var = format!("CARGO_FEATURE_{}", feature.to_uppercase().replace('-', "_"));
3638
if env::var_os(var).is_none() {
3739
continue;
3840
}
3941
pkg_config::Config::new()
42+
.statik(statik)
4043
.atleast_version(version)
4144
.probe(dep)
4245
.unwrap();

0 commit comments

Comments
 (0)