Commit 22734903 authored by Clovis PJ's avatar Clovis PJ Committed by Commit Bot

Generate MojoLPM protobufs from src/

Removing mojolpm.proto copy. Moving generated C++
into fully qualified location.

Change-Id: I27e9a22002506862780258294c4688e5935516d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388440
Commit-Queue: Clovis PJ <clovispj@google.com>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804366}
parent d22473db
...@@ -165,7 +165,7 @@ class Generator(CppGenerator): ...@@ -165,7 +165,7 @@ class Generator(CppGenerator):
import_files = list( import_files = list(
map(lambda x: '{}.mojolpm.proto'.format(x.path), seen_imports)) map(lambda x: '{}.mojolpm.proto'.format(x.path), seen_imports))
if self.needs_mojolpm_proto: if self.needs_mojolpm_proto:
import_files.append('mojolpm.proto') import_files.append('mojo/public/tools/fuzzers/mojolpm.proto')
import_files.sort() import_files.sort()
return import_files return import_files
......
...@@ -961,11 +961,10 @@ template("mojom") { ...@@ -961,11 +961,10 @@ template("mojom") {
sources = process_file_template( sources = process_file_template(
invoker.sources, invoker.sources,
[ "{{source_gen_dir}}/{{source_file_part}}.mojolpm.proto" ]) [ "{{source_gen_dir}}/{{source_file_part}}.mojolpm.proto" ])
import_dirs = [ "${root_gen_dir}" ] import_dirs = [ "//" ]
proto_in_dir = "${root_gen_dir}" proto_in_dir = "${root_gen_dir}"
proto_out_dir = "." proto_out_dir = "."
proto_deps = [ "//mojo/public/tools/fuzzers:mojolpm_proto_copy" ] proto_deps = [ ":$generator_mojolpm_proto_target_name" ]
proto_deps += [ ":$generator_mojolpm_proto_target_name" ]
link_deps = [ "//mojo/public/tools/fuzzers:mojolpm_proto" ] link_deps = [ "//mojo/public/tools/fuzzers:mojolpm_proto" ]
foreach(d, all_deps) { foreach(d, all_deps) {
......
...@@ -62,20 +62,13 @@ proto_library("mojo_fuzzer_proto") { ...@@ -62,20 +62,13 @@ proto_library("mojo_fuzzer_proto") {
sources = [ "mojo_fuzzer.proto" ] sources = [ "mojo_fuzzer.proto" ]
} }
copy("mojolpm_proto_copy") {
sources = [ "mojolpm.proto" ]
outputs = [ "$root_gen_dir/mojolpm.proto" ]
testonly = true
}
proto_library("mojolpm_proto") { proto_library("mojolpm_proto") {
# Work relative to src (//) instead of (by default) the BUILD file.
proto_in_dir = "//"
sources = [ "mojolpm.proto" ] sources = [ "mojolpm.proto" ]
generate_python = false generate_python = false
# TODO(markbrand): this is kind of a hack, but it works. not sure if it's
# the best way to get this generated in the right place though.
proto_out_dir = "mojo/public/tools/fuzzers/../../../../"
proto_deps = [ ":mojolpm_proto_copy" ]
testonly = true testonly = true
} }
......
...@@ -74,10 +74,13 @@ template("mojolpm_fuzzer_test") { ...@@ -74,10 +74,13 @@ template("mojolpm_fuzzer_test") {
proto_target_name = "${target_name}_proto" proto_target_name = "${target_name}_proto"
proto_library(proto_target_name) { proto_library(proto_target_name) {
# Work relative to src (//) instead of (by default) the BUILD file.
proto_in_dir = "//"
sources = [ invoker.proto_source ] sources = [ invoker.proto_source ]
generate_python = false generate_python = false
proto_deps = [ "//mojo/public/tools/fuzzers:mojolpm_proto_copy" ] proto_deps = []
import_dirs = [ root_gen_dir ] import_dirs = [ root_gen_dir ]
...@@ -107,7 +110,7 @@ template("mojolpm_fuzzer_test") { ...@@ -107,7 +110,7 @@ template("mojolpm_fuzzer_test") {
"-I", "-I",
rebase_path(root_gen_dir), rebase_path(root_gen_dir),
"-I", "-I",
get_path_info(rebase_path(inputs[0]), "dir"), rebase_path("//"),
rebase_path(inputs[0]), rebase_path(inputs[0]),
] ]
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "mojo/public/cpp/platform/platform_handle.h" #include "mojo/public/cpp/platform/platform_handle.h"
#include "mojo/public/cpp/system/core.h" #include "mojo/public/cpp/system/core.h"
#include "mojo/public/cpp/system/data_pipe.h" #include "mojo/public/cpp/system/data_pipe.h"
#include "mojolpm.pb.h" #include "mojo/public/tools/fuzzers/mojolpm.pb.h"
#define MOJOLPM_DBG 0 #define MOJOLPM_DBG 0
#if MOJOLPM_DBG #if MOJOLPM_DBG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment