Commit 6a8f2c54 authored by Jamie Madill's avatar Jamie Madill Committed by Commit Bot

Add GN option to disable js protobuf support.

This allows other projects like ANGLE to import protobuf and use the
GN files without importing the JS dependencies.

Bug: angleproject:5161
Change-Id: I71b08c7c03a63a186312edee0a4b55e95e75cf69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2464426
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816251}
parent 852ee23c
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/linux/gtk/gtk.gni") import("//build/config/linux/gtk/gtk.gni")
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
import("//third_party/closure_compiler/compile_js.gni")
# Includes default args like 'enable_js_protobuf'.
import("proto_library.gni")
if (enable_js_protobuf) {
import("//third_party/closure_compiler/compile_js.gni")
}
config("protobuf_config") { config("protobuf_config") {
include_dirs = [ "src" ] include_dirs = [ "src" ]
...@@ -225,10 +230,10 @@ static_library("protobuf_full") { ...@@ -225,10 +230,10 @@ static_library("protobuf_full") {
# The protobuf-based SQLite and GPU fuzzers need protobuf_full and are not # The protobuf-based SQLite and GPU fuzzers need protobuf_full and are not
# included in Chrome. # included in Chrome.
"//third_party/sqlite:sqlite3_lpm_corpus_gen",
"//gpu:gl_lpm_fuzzer_proto", "//gpu:gl_lpm_fuzzer_proto",
"//gpu:gl_lpm_fuzzer_proto_gen", "//gpu:gl_lpm_fuzzer_proto_gen",
"//gpu:gl_lpm_shader_to_string_unittest", "//gpu:gl_lpm_shader_to_string_unittest",
"//third_party/sqlite:sqlite3_lpm_corpus_gen",
# The protobuf-based Mojo LPM fuzzer needs protobuf_full and is not included # The protobuf-based Mojo LPM fuzzer needs protobuf_full and is not included
# in Chrome. # in Chrome.
...@@ -680,7 +685,8 @@ group("py_proto_runtime") { ...@@ -680,7 +685,8 @@ group("py_proto_runtime") {
} }
# JS protobuf library. # JS protobuf library.
js_library("js_proto") { if (enable_js_protobuf) {
js_library("js_proto") {
sources = [ sources = [
"//third_party/google-closure-library/closure/goog/array/array.js", "//third_party/google-closure-library/closure/goog/array/array.js",
"//third_party/google-closure-library/closure/goog/asserts/asserts.js", "//third_party/google-closure-library/closure/goog/asserts/asserts.js",
...@@ -734,4 +740,5 @@ js_library("js_proto") { ...@@ -734,4 +740,5 @@ js_library("js_proto") {
"js/map.js", "js/map.js",
"js/message.js", "js/message.js",
] ]
}
} }
...@@ -120,7 +120,16 @@ ...@@ -120,7 +120,16 @@
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
import("//build/toolchain/kythe.gni") import("//build/toolchain/kythe.gni")
import("//third_party/closure_compiler/compile_js.gni")
declare_args() {
# Allows subprojects to omit javascript dependencies (e.g.) closure_compiler
# and google-closure-library.
enable_js_protobuf = true
}
if (enable_js_protobuf) {
import("//third_party/closure_compiler/compile_js.gni")
}
if (host_os == "win") { if (host_os == "win") {
_host_executable_suffix = ".exe" _host_executable_suffix = ".exe"
......
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