forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add build scripts for Rust flatbuffers. - Rewrites some reply.cc methods in Rust. - Changes some struct elements to table in msg.fbs (rust flatbuffers lacks support currently) - Renames handlers_test to test_rs. - This reorg is needed to make progress on the code cache handler.
- Loading branch information
Showing
13 changed files
with
377 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import("//build_extra/rust/rust.gni") | ||
|
||
rust_component("flatbuffers") { | ||
source_root = "//third_party/flatbuffers/rust/flatbuffers/src/lib.rs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import("//build_extra/rust/rust.gni") | ||
|
||
# TODO(ry) "flatbuffer.gni" should be "flatbuffers.gni" we should be consistant | ||
# in our pluralization. | ||
import("//build_extra/flatbuffers/flatbuffer.gni") | ||
|
||
template("rust_flatbuffer") { | ||
action_name = "${target_name}_gen" | ||
source_set_name = target_name | ||
compiled_action_foreach(action_name) { | ||
tool = "$flatbuffers_build_location:flatc" | ||
|
||
sources = invoker.sources | ||
deps = [] | ||
out_dir = target_gen_dir | ||
|
||
outputs = [ | ||
"$out_dir/{{source_name_part}}_generated.rs", | ||
] | ||
|
||
args = [ | ||
"--rust", | ||
"-o", | ||
rebase_path(out_dir, root_build_dir), | ||
"-I", | ||
rebase_path("//", root_build_dir), | ||
] | ||
args += [ "{{source}}" ] | ||
|
||
# The deps may have steps that have to run before running flatc. | ||
if (defined(invoker.deps)) { | ||
deps += invoker.deps | ||
} | ||
} | ||
|
||
rust_component(source_set_name) { | ||
sources = get_target_outputs(":$action_name") | ||
source_root = sources[0] | ||
deps = [ | ||
":$action_name", | ||
] | ||
extern = [ "//build_extra/flatbuffers/rust:flatbuffers" ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.