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):
import_files = list(
map(lambda x: '{}.mojolpm.proto'.format(x.path), seen_imports))
if self.needs_mojolpm_proto:
import_files.append('mojolpm.proto')
import_files.append('mojo/public/tools/fuzzers/mojolpm.proto')
import_files.sort()
return import_files
......
......@@ -961,11 +961,10 @@ template("mojom") {
sources = process_file_template(
invoker.sources,
[ "{{source_gen_dir}}/{{source_file_part}}.mojolpm.proto" ])
import_dirs = [ "${root_gen_dir}" ]
import_dirs = [ "//" ]
proto_in_dir = "${root_gen_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" ]
foreach(d, all_deps) {
......
......@@ -62,20 +62,13 @@ proto_library("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") {
# Work relative to src (//) instead of (by default) the BUILD file.
proto_in_dir = "//"
sources = [ "mojolpm.proto" ]
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
}
......
......@@ -74,10 +74,13 @@ template("mojolpm_fuzzer_test") {
proto_target_name = "${target_name}_proto"
proto_library(proto_target_name) {
# Work relative to src (//) instead of (by default) the BUILD file.
proto_in_dir = "//"
sources = [ invoker.proto_source ]
generate_python = false
proto_deps = [ "//mojo/public/tools/fuzzers:mojolpm_proto_copy" ]
proto_deps = []
import_dirs = [ root_gen_dir ]
......@@ -107,7 +110,7 @@ template("mojolpm_fuzzer_test") {
"-I",
rebase_path(root_gen_dir),
"-I",
get_path_info(rebase_path(inputs[0]), "dir"),
rebase_path("//"),
rebase_path(inputs[0]),
]
......
......@@ -19,7 +19,7 @@
#include "mojo/public/cpp/platform/platform_handle.h"
#include "mojo/public/cpp/system/core.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
#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