// The login-session display backend (feature `drm`, on by default) compiles the compositor's own // C shim for DRM/KMS + libinput + libseat + xkbcommon and links the libraries it uses. fn main() { #[cfg(feature = "drm")] { cc::Build::new() .file("csrc/kms.c") .include("csrc/fake") .include("/usr/include/libdrm") .warnings(false) .compile("kms"); for lib in ["drm", "input", "seat", "xkbcommon", "udev"] { println!("cargo:rustc-link-lib={lib}"); } // libseat comes from the pixi env (see pixi.toml). Record its lib dir in the binary so // the login session finds it without LD_LIBRARY_PATH, which apps started by the // compositor would inherit. let pixi_lib = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../.pixi/envs/default/lib"); if let Ok(dir) = pixi_lib.canonicalize() { println!("cargo:rustc-link-arg-bins=-Wl,-rpath,{}", dir.display()); } println!("cargo:rerun-if-changed=csrc/kms.c"); println!("cargo:rerun-if-changed=../compositor/kms/kms_stub.c"); } }