wayland: add wl_drm protocol

This commit is contained in:
Victoria Brekenfeld 2022-03-16 20:19:12 +01:00
parent 7c014af495
commit 749a032507
7 changed files with 320 additions and 1 deletions

View file

@ -1,6 +1,12 @@
// SPDX-License-Identifier: GPL-3.0-only
extern crate wayland_scanner;
use std::process::Command;
use wayland_scanner::{Side, generate_code};
use std::{
env,
process::Command,
path::PathBuf,
};
fn main() {
if let Some(output) = Command::new("git")
@ -11,4 +17,15 @@ fn main() {
let git_hash = String::from_utf8(output.stdout).unwrap();
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
}
let dest = PathBuf::from(&env::var("OUT_DIR").unwrap());
// Location of the xml file, relative to the `Cargo.toml`
let drm_protocol_file = "resources/wayland-drm.xml";
// Target directory for the generate files
generate_code(
drm_protocol_file,
&dest.join("wl_drm.rs"),
Side::Server,
);
}