0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
denoland-deno/build_extra/rust/run.py
Bert Belder ec17239f46
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.
2018-11-01 14:18:18 +01:00

13 lines
454 B
Python

#!/usr/bin/env python
# This file just executes its arguments, except that also adds GN_OUT_DIR to the
# environ. This is for compatibility with cargo.
import subprocess
import sys
import os
# This is for src/msg.rs to know where to find msg_generated.rs.
# When building with Cargo this variable is set by build.rs.
os.environ["GN_OUT_DIR"] = os.path.abspath(".")
assert os.path.isdir(os.environ["GN_OUT_DIR"])
sys.exit(subprocess.call(sys.argv[1:]))