From ec17239f46fa8677975183e0ab4a0bc7adcff77e Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 1 Nov 2018 06:06:55 +0100 Subject: cargo: build in Cargo's out dir if DENO_BUILD_PATH is not set Plus some minor improvements and clean-ups: * Resolve DENO_BUILD_PATH to an absolute path if necessary. * Rename DENO_BUILD_PATH to GN_OUT_DIR in places where it is supposed to be set by the build system (and not a user configuration variable). * Output Cargo `rerun-if-*-changed` instructions first, so even if the build itself fails, configuration changes will still trigger a re-run of build.rs. * Remove TODOs that are impossible. * Re-run build.rs when the flatbuffer definition file changes. --- src/msg.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/msg.rs b/src/msg.rs index 5c0244509..fcb10fff5 100644 --- a/src/msg.rs +++ b/src/msg.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] #![allow(dead_code)] use flatbuffers; -// TODO Replace DENO_BUILD_PATH with OUT_DIR. gn/ninja should generate into -// the same output directory as cargo uses. -include!(concat!(env!("DENO_BUILD_PATH"), "/gen/msg_generated.rs")); +// GN_OUT_DIR is set either by build.rs (for the Cargo build), or by +// build_extra/rust/run.py (for the GN+Ninja build). +include!(concat!(env!("GN_OUT_DIR"), "/gen/msg_generated.rs")); -- cgit v1.2.3