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

Unified Diff: third_party/protobuf/BUILD.gn

Issue 603143002: gn: Fix more build issues on Win (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: += instead of = Created 6 years, 3 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 | « net/third_party/nss/ssl/BUILD.gn ('k') | tools/gn/source_file_type.cc » ('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 265499ce28cfdca719b49920f60ca709250b1491..b2eab67e85d43fdd82e5333b5a2d50f7254a863a 100644
--- a/third_party/protobuf/BUILD.gn
+++ b/third_party/protobuf/BUILD.gn
@@ -14,7 +14,6 @@ config("protobuf_config") {
config_h_dir,
]
defines = [
- "PROTOBUF_USE_DLLS",
"GOOGLE_PROTOBUF_NO_RTTI",
"GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
]
@@ -25,6 +24,12 @@ config("protobuf_config") {
}
}
+if (component_mode == "shared_library") {
+ config("protobuf_use_dlls") {
+ defines = [ "PROTOBUF_USE_DLLS" ]
+ }
+}
+
# This condif should be applied to targets using generated code from the proto
# compiler. It sets up the include directories properly.
config("using_proto") {
@@ -84,7 +89,7 @@ if (is_win) {
]
}
-source_set("protobuf_lite") {
+component("protobuf_lite") {
sources = protobuf_lite_sources
configs -= [ "//build/config/compiler:chromium_code" ]
@@ -97,7 +102,10 @@ source_set("protobuf_lite") {
cflags = protobuf_lite_cflags
# Required for component builds. See http://crbug.com/172800.
- defines = [ "LIBPROTOBUF_EXPORTS" ]
+ if (component_mode == "shared_library") {
+ public_configs += [ ":protobuf_use_dlls" ]
+ defines = [ "LIBPROTOBUF_EXPORTS" ]
+ }
}
# This is the full, heavy protobuf lib that's needed for c++ .protos that don't
« no previous file with comments | « net/third_party/nss/ssl/BUILD.gn ('k') | tools/gn/source_file_type.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698