diff options
| author | Ryan Dahl <ry@tinyclouds.org> | 2018-10-31 00:32:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-31 00:32:42 -0700 |
| commit | 7c82667f75fdfe56ca66ccc0dbe2c92a989ba858 (patch) | |
| tree | 0d75ddd4f73d046727bdd0369515b09532647c16 /build_extra | |
| parent | 2422e526257d971ba382bb9195e0ee527b918672 (diff) | |
Upgrade Flatbuffers. (#1127)
Use msg_generated.rs as mod instead of crate.
Diffstat (limited to 'build_extra')
| -rw-r--r-- | build_extra/flatbuffers/rust/rust_flatbuffer.gni | 13 | ||||
| -rw-r--r-- | build_extra/rust/run.py | 10 | ||||
| -rw-r--r-- | build_extra/rust/rust.gni | 2 |
3 files changed, 12 insertions, 13 deletions
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, ] |
