Commit 9ecf38fb authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[tracing] Fix perfetto build on windows

Add .exe to the produced executable for the protoc compiler.

Use include_dirs instead of -isystem. Remove some more warnings that
that causes.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: Ia6b0df63107470ec78f8038834205a0e4fe34b21
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1632069
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61893}
parent b7744db7
......@@ -3681,8 +3681,8 @@ v8_component("v8_libplatform") {
"src/libplatform/tracing/trace-event-listener.h",
]
deps += [
"third_party/perfetto:libperfetto",
"third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
"//third_party/perfetto:libperfetto",
"//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
]
}
}
......@@ -4420,16 +4420,13 @@ if (!build_with_chromium && v8_use_perfetto) {
"GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
]
cflags = [
# Using -isystem instead of include_dirs (-I), so we don't need to suppress
# warnings coming from libprotobuf headers. Doing so would mask warnings in
# our own code.
"-isystem",
rebase_path("third_party/protobuf/src", root_build_dir),
"-Wno-unknown-warning-option",
"-Wno-deprecated",
"-Wno-undef",
"-Wno-zero-as-null-pointer-constant",
"-Wno-thread-safety-attributes",
]
include_dirs = [ "third_party/protobuf/src" ]
}
# Configuration used to build libprotobuf_* and the protoc compiler.
......@@ -4437,7 +4434,9 @@ if (!build_with_chromium && v8_use_perfetto) {
# Apply the lighter supressions and macro definitions from above.
configs = [ ":protobuf_gen_config" ]
defines = [ "HAVE_PTHREAD=1" ]
if (!is_win) {
defines = [ "HAVE_PTHREAD=1" ]
}
if (is_clang) {
cflags = [
"-Wno-unused-private-field",
......@@ -4449,6 +4448,9 @@ if (!build_with_chromium && v8_use_perfetto) {
"-Wno-tautological-constant-compare",
]
}
if (is_win) {
cflags += [ "-Wno-microsoft-unqualified-friend" ]
}
}
source_set("protobuf_lite") {
......@@ -4483,6 +4485,9 @@ if (!build_with_chromium && v8_use_perfetto) {
"//build/config/compiler:no_chromium_code",
":protobuf_config",
]
if (is_win) {
configs -= [ "//build/config/win:lean_and_mean" ]
}
public_configs = [ ":protobuf_gen_config" ]
}
......@@ -4552,6 +4557,9 @@ if (!build_with_chromium && v8_use_perfetto) {
"//build/config/compiler:no_chromium_code",
":protobuf_config",
]
if (is_win) {
configs -= [ "//build/config/win:lean_and_mean" ]
}
public_configs = [ ":protobuf_gen_config" ]
}
......@@ -4587,6 +4595,9 @@ if (!build_with_chromium && v8_use_perfetto) {
"//build/config/compiler:no_chromium_code",
":protobuf_config",
]
if (is_win) {
configs -= [ "//build/config/win:lean_and_mean" ]
}
public_configs = [ ":protobuf_gen_config" ]
}
......
......@@ -13,6 +13,12 @@ template("proto_library") {
set_sources_assignment_filter([])
if (host_os == "win") {
host_executable_suffix = ".exe"
} else {
host_executable_suffix = ""
}
# All the proto imports should be relative to the project root.
proto_in_dir = "//"
if (defined(invoker.proto_in_dir)) {
......@@ -42,8 +48,9 @@ template("proto_library") {
if (defined(invoker.generator_plugin_label)) {
plugin_host_label = invoker.generator_plugin_label + "($host_toolchain)"
plugin_path = get_label_info(plugin_host_label, "root_out_dir") + "/" +
get_label_info(plugin_host_label, "name")
plugin_path =
get_label_info(plugin_host_label, "root_out_dir") + "/" +
get_label_info(plugin_host_label, "name") + host_executable_suffix
generate_with_plugin = true
} else if (defined(invoker.generator_plugin_script)) {
plugin_path = invoker.generator_plugin_script
......@@ -107,7 +114,8 @@ template("proto_library") {
outputs = get_path_info(protogens, "abspath")
protoc_label = "//:protoc($host_toolchain)"
protoc_path = get_label_info(protoc_label, "root_out_dir") + "/protoc"
protoc_path = get_label_info(protoc_label, "root_out_dir") + "/protoc" +
host_executable_suffix
args = [
# Path should be rebased because |root_build_dir| for current toolchain
# may be different from |root_out_dir| of protoc built on host toolchain.
......
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