Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: third_party/protobuf/BUILD.gn

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/grpc/vsprojects/vcxproj/grpc/packages.config ('k') | third_party/protobuf/protobuf.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/BUILD.gn
diff --git a/third_party/protobuf/BUILD.gn b/third_party/protobuf/BUILD.gn
index e4520ec1473d5eb090d1ac311fa489f7938a2154..8211662957579b073146ca338822f42b2946dc75 100644
--- a/third_party/protobuf/BUILD.gn
+++ b/third_party/protobuf/BUILD.gn
@@ -306,6 +306,10 @@ source_set("protobuf_full") {
"src/google/protobuf/wrappers.pb.h",
]
+ deps = [
+ "//build/config/sanitizers:deps",
+ ]
+
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
@@ -329,7 +333,10 @@ source_set("protobuf_full") {
# Only compile the compiler for the host architecture.
if (current_toolchain == host_toolchain) {
- executable("protoc") {
+ # protoc compiler is separated into protoc library and executable targets to
+ # support protoc plugins that need to link libprotoc, but not the main()
+ # itself. See src/google/protobuf/compiler/plugin.h
+ source_set("protoc_lib") {
sources = [
"src/google/protobuf/compiler/code_generator.cc",
"src/google/protobuf/compiler/code_generator.h",
@@ -476,7 +483,6 @@ if (current_toolchain == host_toolchain) {
"src/google/protobuf/compiler/javanano/javanano_primitive_field.h",
"src/google/protobuf/compiler/js/js_generator.cc",
"src/google/protobuf/compiler/js/js_generator.h",
- "src/google/protobuf/compiler/main.cc",
"src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
"src/google/protobuf/compiler/objectivec/objectivec_enum.h",
"src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
@@ -528,16 +534,31 @@ if (current_toolchain == host_toolchain) {
configs -= [ "//build/config/win:lean_and_mean" ]
}
+ public_configs = [ ":protobuf_config" ]
+
cflags = protobuf_lite_cflags
- deps = [
+ public_deps = [
":protobuf_full",
- "//build/config/sanitizers:deps",
+ ]
+ }
+
+ executable("protoc") {
+ sources = [
+ "src/google/protobuf/compiler/main.cc",
+ ]
+
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+
+ cflags = protobuf_lite_cflags
+
+ deps = [
+ ":protoc_lib",
# Default manifest on Windows (a no-op elsewhere).
"//build/win:default_exe_manifest",
]
- deps += [ "//build/config/sanitizers:deps" ]
}
}
« no previous file with comments | « third_party/grpc/vsprojects/vcxproj/grpc/packages.config ('k') | third_party/protobuf/protobuf.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698