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

Side by Side Diff: third_party/protobuf/BUILD.gn

Issue 1265263002: Use new GN features in the build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 if (is_win) { 5 if (is_win) {
6 config_h_dir = "vsprojects" 6 config_h_dir = "vsprojects"
7 } else { 7 } else {
8 config_h_dir = "." 8 config_h_dir = "."
9 } 9 }
10 10
11 config("protobuf_config") { 11 config("protobuf_config") {
12 include_dirs = [ 12 include_dirs = [
13 "src", 13 "src",
14 config_h_dir, 14 config_h_dir,
15 ] 15 ]
16 defines = [ 16 defines = [
17 "GOOGLE_PROTOBUF_NO_RTTI", 17 "GOOGLE_PROTOBUF_NO_RTTI",
18 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", 18 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
19 ] 19 ]
20 } 20 }
21 21
22 if (component_mode == "shared_library") { 22 if (is_component_build) {
23 config("protobuf_use_dlls") { 23 config("protobuf_use_dlls") {
24 defines = [ "PROTOBUF_USE_DLLS" ] 24 defines = [ "PROTOBUF_USE_DLLS" ]
25 } 25 }
26 } 26 }
27 27
28 # This config should be applied to targets using generated code from the proto 28 # This config should be applied to targets using generated code from the proto
29 # compiler. It sets up the include directories properly. 29 # compiler. It sets up the include directories properly.
30 config("using_proto") { 30 config("using_proto") {
31 include_dirs = [ 31 include_dirs = [
32 "src", 32 "src",
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 public_configs = [ 96 public_configs = [
97 ":protobuf_config", 97 ":protobuf_config",
98 98
99 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 99 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
100 "//build/config/compiler:no_size_t_to_int_warning", 100 "//build/config/compiler:no_size_t_to_int_warning",
101 ] 101 ]
102 102
103 cflags = protobuf_lite_cflags 103 cflags = protobuf_lite_cflags
104 104
105 # Required for component builds. See http://crbug.com/172800. 105 # Required for component builds. See http://crbug.com/172800.
106 if (component_mode == "shared_library") { 106 if (is_component_build) {
107 public_configs += [ ":protobuf_use_dlls" ] 107 public_configs += [ ":protobuf_use_dlls" ]
108 defines = [ "LIBPROTOBUF_EXPORTS" ] 108 defines = [ "LIBPROTOBUF_EXPORTS" ]
109 } 109 }
110 } 110 }
111 111
112 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't 112 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't
113 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls 113 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls
114 # into that category. Do not use in Chrome code. 114 # into that category. Do not use in Chrome code.
115 115
116 source_set("protobuf_full") { 116 source_set("protobuf_full") {
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 ":copy_google", 329 ":copy_google",
330 ":copy_google_protobuf", 330 ":copy_google_protobuf",
331 ":copy_google_protobuf_internal", 331 ":copy_google_protobuf_internal",
332 ] 332 ]
333 333
334 # Targets that depend on this should depend on the copied data files. 334 # Targets that depend on this should depend on the copied data files.
335 data = get_target_outputs(":copy_google") 335 data = get_target_outputs(":copy_google")
336 data += get_target_outputs(":copy_google_protobuf") 336 data += get_target_outputs(":copy_google_protobuf")
337 data += get_target_outputs(":copy_google_protobuf_internal") 337 data += get_target_outputs(":copy_google_protobuf_internal")
338 } 338 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698