Updated to correctly build kernel and sommelier

This commit is contained in:
Bruce Leidl 2023-01-27 16:38:08 -05:00
parent 3a05847f31
commit f938e1a785

View File

@ -5,10 +5,12 @@ use std::process::Command;
fn main() -> Result<()> { fn main() -> Result<()> {
build_phinit()?; build_phinit()?;
run_simple_make("sommelier")?; build_kernel()?;
run_simple_make("kernel")?; build_sommelier()?;
// Rerun build.rs upon making or pulling in new commits // Rerun build.rs upon making or pulling in new commits
println!("cargo:rerun-if-changed=.git/refs/heads/master"); println!("cargo:rerun-if-changed=.git/refs/heads/master");
println!("cargo:rerun-if-changed=ph-init/src");
println!("cargo:rerun-if-changed=build.rs");
Ok(()) Ok(())
} }
@ -27,9 +29,30 @@ fn build_phinit() -> Result<()> {
Ok(()) Ok(())
} }
fn run_simple_make<P: AsRef<Path>>(directory: P) -> Result<()> { fn build_kernel() -> Result<()> {
let _dir = ChdirTo::path(directory); Command::new("make")
Command::new("make").status()?; .arg("-C")
.arg("kernel")
.status()?;
Ok(())
}
fn build_sommelier() -> Result<()> {
Command::new("meson")
.arg("setup")
.arg("-Dxwayland_path=/usr/bin/Xwayland")
.arg("-Dxwayland_gl_driver_path=")
.arg("-Dwith_tests=false")
.arg("sommelier/build")
.arg("sommelier")
.status()?;
Command::new("meson")
.arg("compile")
.arg("-C")
.arg("sommelier/build")
.status()?;
Ok(()) Ok(())
} }