From 7c82667f75fdfe56ca66ccc0dbe2c92a989ba858 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 31 Oct 2018 00:32:42 -0700 Subject: Upgrade Flatbuffers. (#1127) Use msg_generated.rs as mod instead of crate. --- build_extra/flatbuffers/rust/rust_flatbuffer.gni | 13 +------------ build_extra/rust/run.py | 10 ++++++++++ build_extra/rust/rust.gni | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 build_extra/rust/run.py (limited to 'build_extra') diff --git a/build_extra/flatbuffers/rust/rust_flatbuffer.gni b/build_extra/flatbuffers/rust/rust_flatbuffer.gni index 4255b21ec..3d01562be 100644 --- a/build_extra/flatbuffers/rust/rust_flatbuffer.gni +++ b/build_extra/flatbuffers/rust/rust_flatbuffer.gni @@ -5,9 +5,7 @@ import("//build_extra/rust/rust.gni") import("//build_extra/flatbuffers/flatbuffer.gni") template("rust_flatbuffer") { - action_name = "${target_name}_gen" - source_set_name = target_name - compiled_action_foreach(action_name) { + compiled_action_foreach(target_name) { tool = "$flatbuffers_build_location:flatc" sources = invoker.sources @@ -32,13 +30,4 @@ template("rust_flatbuffer") { deps += invoker.deps } } - - rust_crate(source_set_name) { - sources = get_target_outputs(":$action_name") - source_root = sources[0] - deps = [ - ":$action_name", - ] - extern = [ "//build_extra/flatbuffers/rust:flatbuffers" ] - } } diff --git a/build_extra/rust/run.py b/build_extra/rust/run.py new file mode 100644 index 000000000..276e799cc --- /dev/null +++ b/build_extra/rust/run.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +# This file just executes its arguments, except that also adds OUT_DIR to the +# environ. This is for compatibility with cargo. +import subprocess +import sys +import os + +os.environ["OUT_DIR"] = os.path.abspath(".") +assert os.path.isdir(os.environ["OUT_DIR"]) +sys.exit(subprocess.call(sys.argv[1:], env=os.environ)) diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni index 889e25467..c7ad376d0 100644 --- a/build_extra/rust/rust.gni +++ b/build_extra/rust/rust.gni @@ -151,7 +151,7 @@ template("rust_crate") { } action(action_name) { - script = "//third_party/v8/tools/run.py" + script = "//build_extra/rust/run.py" sources = [ source_root, ] -- cgit v1.2.3