2021-05-24 13:04:28 -07:00
|
|
|
extern crate wayland_scanner;
|
|
|
|
|
|
|
|
use std::path::Path;
|
|
|
|
use wayland_scanner::{generate_code, Side};
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
generate("river_status_unstable_v1");
|
|
|
|
}
|
|
|
|
|
|
|
|
fn generate(protocol_name: &str) {
|
|
|
|
let out_dir = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/src/wayland/"));
|
|
|
|
|
|
|
|
let mut protocol_dir = String::from(concat!(env!("CARGO_MANIFEST_DIR"), "/protocol/"));
|
2021-11-20 15:13:23 -08:00
|
|
|
protocol_dir.push_str(&protocol_name.replace("_", "-"));
|
2021-05-24 13:04:28 -07:00
|
|
|
protocol_dir.push_str(".xml");
|
|
|
|
|
|
|
|
let protocol = Path::new(&protocol_dir);
|
|
|
|
let mut protocol_file = protocol_name.to_string();
|
|
|
|
protocol_file.push_str(".rs");
|
|
|
|
|
|
|
|
generate_code(protocol, out_dir.join(protocol_file), Side::Client);
|
|
|
|
}
|