From d80eabc803ce0d4f4a9156e61ae68b4ec8dce490 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Fri, 29 Oct 2021 16:38:11 +0100 Subject: [PATCH] Use constants for third_party code locations rather than hard-coding. The constants already existed but weren't being used consistently. This will make the Android downstream patches to change the paths a little simpler. BUG=b:204072128 TEST=tools/run_tests Change-Id: If9b81ef9ca0a7c52f0d9fe7cf836841027a2c92d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3253369 Tested-by: kokoro Commit-Queue: Andrew Walbran Auto-Submit: Andrew Walbran Reviewed-by: Dennis Kempin --- rutabaga_gfx/build.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/rutabaga_gfx/build.rs b/rutabaga_gfx/build.rs index 840b47bf25..945062871c 100644 --- a/rutabaga_gfx/build.rs +++ b/rutabaga_gfx/build.rs @@ -48,10 +48,11 @@ fn build_minigbm(out_dir: &Path) -> Result<()> { return Ok(()); } - if !Path::new("../third_party/minigbm/.git").exists() { + if !Path::new(MINIGBM_SRC).join(".git").exists() { bail!( - "third_party/minigbm source does not exist, did you forget to \ - `git submodule update --init`?" + "{} source does not exist, did you forget to \ + `git submodule update --init`?", + MINIGBM_SRC ); } @@ -61,7 +62,7 @@ fn build_minigbm(out_dir: &Path) -> Result<()> { .env("CROSS_COMPILE", get_cross_compile_prefix()) .arg(format!("OUT={}", out_dir.display())) .arg("CC_STATIC_LIBRARY(libminigbm.pie.a)") - .current_dir("../third_party/minigbm") + .current_dir(MINIGBM_SRC) .status()?; if !status.success() { bail!("make failed with status: {}", status); @@ -78,10 +79,11 @@ fn build_virglrenderer(out_dir: &Path) -> Result<()> { return Ok(()); } - if !Path::new("../third_party/virglrenderer/.git").exists() { + if !Path::new(VIRGLRENDERER_SRC).join(".git").exists() { bail!( - "third_party/virglrenderer source does not exist, did you forget to \ - `git submodule update --init`?" + "{} source does not exist, did you forget to \ + `git submodule update --init`?", + VIRGLRENDERER_SRC ); }