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 <noreply+kokoro@google.com>
Commit-Queue: Andrew Walbran <qwandor@google.com>
Auto-Submit: Andrew Walbran <qwandor@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
Andrew Walbran 2021-10-29 16:38:11 +01:00 committed by Commit Bot
parent 8f5978fda2
commit d80eabc803

View file

@ -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
);
}