aboutsummaryrefslogtreecommitdiffstats
path: root/input-emulation/build.rs
blob: e9b39c1a2fada850d79701d0eefb2bc291e61c45 (plain) (blame)
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
fn main() {
    let unix = cfg!(unix);
    let libei = cfg!(feature = "libei");
    let x11 = cfg!(feature = "x11");
    let macos = cfg!(target_os = "macos");
    let wlroots = cfg!(feature = "wlroots");
    let rdp = cfg!(feature = "remote_desktop_portal");

    let libei = unix && !macos && libei;
    let wlroots = unix && !macos && wlroots;
    let x11 = unix && !macos && x11;
    let rdp = unix && !macos && rdp;

    println!("cargo::rustc-check-cfg=cfg(wlroots)");
    println!("cargo::rustc-check-cfg=cfg(libei)");
    println!("cargo::rustc-check-cfg=cfg(x11)");
    println!("cargo::rustc-check-cfg=cfg(rdp)");

    if libei {
        println!("cargo::rustc-cfg=libei");
    }
    if x11 {
        println!("cargo::rustc-cfg=x11");
    }
    if wlroots {
        println!("cargo::rustc-cfg=wlroots");
    }
    if rdp {
        println!("cargo::rustc-cfg=rdp");
    }
}