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

Unified Diff: third_party/protobuf/BUILD.gn

Issue 2762193002: [protobuf] Fix potential double definition build errors. (Closed)
Patch Set: add protobuf_globals_sources Created 3 years, 9 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 | « no previous file | no next file » | 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 6fb6d6ad30439ccee3fb4dcac22cec4b90c454f0..a9541cadd43d9eee7239132441c8b863760d9c22 100644
--- a/third_party/protobuf/BUILD.gn
+++ b/third_party/protobuf/BUILD.gn
@@ -36,6 +36,11 @@ config("using_proto") {
]
}
+protobuf_globals_sources = [
+ "src/google/protobuf/globals.cc",
+ "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
+]
+
protobuf_lite_sources = [
"src/google/protobuf/arena.cc",
"src/google/protobuf/arena.h",
@@ -73,7 +78,6 @@ protobuf_lite_sources = [
"src/google/protobuf/stubs/atomicops_internals_ppc_gcc.h",
"src/google/protobuf/stubs/atomicops_internals_solaris.h",
"src/google/protobuf/stubs/atomicops_internals_tsan.h",
- "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
"src/google/protobuf/stubs/atomicops_internals_x86_gcc.h",
"src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc",
"src/google/protobuf/stubs/atomicops_internals_x86_msvc.h",
@@ -160,10 +164,7 @@ if (is_component_build && is_linux && !is_chromeos) {
":protobuf_use_dlls",
]
defines = [ "LIBPROTOBUF_EXPORTS" ]
- sources = [
- "src/google/protobuf/globals.cc",
- "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
- ]
+ sources = protobuf_globals_sources
}
}
@@ -199,7 +200,7 @@ target(link_target_type, "protobuf_lite") {
if (is_component_build && is_linux && !is_chromeos) {
deps += [ ":protobuf_globals" ]
} else {
- sources += [ "src/google/protobuf/globals.cc" ]
+ sources += protobuf_globals_sources
}
# Required for component builds. See http://crbug.com/172800.
@@ -221,8 +222,7 @@ static_library("protobuf_full") {
"//third_party/libprotobuf-mutator:*",
]
- sources = protobuf_lite_sources
- sources += [
+ sources = protobuf_lite_sources + protobuf_globals_sources + [
"src/google/protobuf/any.cc",
"src/google/protobuf/any.h",
"src/google/protobuf/any.pb.cc",
@@ -252,7 +252,6 @@ static_library("protobuf_full") {
"src/google/protobuf/generated_enum_util.h",
"src/google/protobuf/generated_message_reflection.cc",
"src/google/protobuf/generated_message_reflection.h",
- "src/google/protobuf/globals.cc",
# gzip_stream.cc pulls in zlib, but it's not actually used by protoc, just
# by test code, so instead of compiling zlib for the host, let's just
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698