mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
Upgrade Flatbuffers. (#1127)
Use msg_generated.rs as mod instead of crate.
This commit is contained in:
parent
2422e52625
commit
7c82667f75
8 changed files with 20 additions and 17 deletions
2
BUILD.gn
2
BUILD.gn
|
@ -64,7 +64,6 @@ main_extern = [
|
||||||
"$rust_build:tokio_threadpool",
|
"$rust_build:tokio_threadpool",
|
||||||
"$rust_build:url",
|
"$rust_build:url",
|
||||||
"//build_extra/flatbuffers/rust:flatbuffers",
|
"//build_extra/flatbuffers/rust:flatbuffers",
|
||||||
":msg_rs",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
ts_sources = [
|
ts_sources = [
|
||||||
|
@ -126,6 +125,7 @@ rust_executable("deno") {
|
||||||
extern = main_extern
|
extern = main_extern
|
||||||
deps = [
|
deps = [
|
||||||
":libdeno",
|
":libdeno",
|
||||||
|
":msg_rs",
|
||||||
":snapshot",
|
":snapshot",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,7 @@ import("//build_extra/rust/rust.gni")
|
||||||
import("//build_extra/flatbuffers/flatbuffer.gni")
|
import("//build_extra/flatbuffers/flatbuffer.gni")
|
||||||
|
|
||||||
template("rust_flatbuffer") {
|
template("rust_flatbuffer") {
|
||||||
action_name = "${target_name}_gen"
|
compiled_action_foreach(target_name) {
|
||||||
source_set_name = target_name
|
|
||||||
compiled_action_foreach(action_name) {
|
|
||||||
tool = "$flatbuffers_build_location:flatc"
|
tool = "$flatbuffers_build_location:flatc"
|
||||||
|
|
||||||
sources = invoker.sources
|
sources = invoker.sources
|
||||||
|
@ -32,13 +30,4 @@ template("rust_flatbuffer") {
|
||||||
deps += invoker.deps
|
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" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
10
build_extra/rust/run.py
Normal file
10
build_extra/rust/run.py
Normal file
|
@ -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))
|
|
@ -151,7 +151,7 @@ template("rust_crate") {
|
||||||
}
|
}
|
||||||
|
|
||||||
action(action_name) {
|
action(action_name) {
|
||||||
script = "//third_party/v8/tools/run.py"
|
script = "//build_extra/rust/run.py"
|
||||||
sources = [
|
sources = [
|
||||||
source_root,
|
source_root,
|
||||||
]
|
]
|
||||||
|
|
|
@ -37,7 +37,7 @@ solutions = [{
|
||||||
'cpplint'
|
'cpplint'
|
||||||
}, {
|
}, {
|
||||||
'url':
|
'url':
|
||||||
'https://github.com/google/flatbuffers.git@d840856093fa7b935b0d6378c436bd633d006c8c',
|
'https://github.com/google/flatbuffers.git@160e8f2fdc9d5989e652709fae3fac0bd9aaed14',
|
||||||
'name':
|
'name':
|
||||||
'flatbuffers'
|
'flatbuffers'
|
||||||
}]
|
}]
|
||||||
|
|
|
@ -5,7 +5,6 @@ extern crate getopts;
|
||||||
extern crate hyper;
|
extern crate hyper;
|
||||||
extern crate hyper_rustls;
|
extern crate hyper_rustls;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
extern crate msg_rs as msg;
|
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
extern crate remove_dir_all;
|
extern crate remove_dir_all;
|
||||||
extern crate ring;
|
extern crate ring;
|
||||||
|
@ -31,6 +30,7 @@ mod fs;
|
||||||
mod http_util;
|
mod http_util;
|
||||||
mod isolate;
|
mod isolate;
|
||||||
mod libdeno;
|
mod libdeno;
|
||||||
|
mod msg;
|
||||||
pub mod ops;
|
pub mod ops;
|
||||||
mod permissions;
|
mod permissions;
|
||||||
mod resources;
|
mod resources;
|
||||||
|
|
4
src/msg.rs
Normal file
4
src/msg.rs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#![allow(unused_imports)]
|
||||||
|
#![allow(dead_code)]
|
||||||
|
use flatbuffers;
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/gen/msg_generated.rs"));
|
|
@ -1 +1 @@
|
||||||
Subproject commit 56c4acce2e8ffe979b2e7d52d2b3e6f613ed492e
|
Subproject commit c103d4620cf6df002b1a733963a9cb82a42df83d
|
Loading…
Reference in a new issue