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

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

Issue 929793006: Update existing uses of /wd4267 to use the GN config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@x64
Patch Set: Created 5 years, 10 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
« no previous file with comments | « third_party/libpng/BUILD.gn ('k') | third_party/re2/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
21 if (is_win) {
22 # TODO(jschuh): http://crbug.com/167187 size_t -> int.
23 cflags = [ "/wd4267" ]
24 }
25 } 20 }
26 21
27 if (component_mode == "shared_library") { 22 if (component_mode == "shared_library") {
28 config("protobuf_use_dlls") { 23 config("protobuf_use_dlls") {
29 defines = [ "PROTOBUF_USE_DLLS" ] 24 defines = [ "PROTOBUF_USE_DLLS" ]
30 } 25 }
31 } 26 }
32 27
33 # 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
34 # compiler. It sets up the include directories properly. 29 # compiler. It sets up the include directories properly.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 86 }
92 87
93 component("protobuf_lite") { 88 component("protobuf_lite") {
94 sources = protobuf_lite_sources 89 sources = protobuf_lite_sources
95 90
96 configs -= [ "//build/config/compiler:chromium_code" ] 91 configs -= [ "//build/config/compiler:chromium_code" ]
97 configs += [ "//build/config/compiler:no_chromium_code" ] 92 configs += [ "//build/config/compiler:no_chromium_code" ]
98 if (is_win) { 93 if (is_win) {
99 configs -= [ "//build/config/win:lean_and_mean" ] 94 configs -= [ "//build/config/win:lean_and_mean" ]
100 } 95 }
101 public_configs = [ ":protobuf_config" ] 96 public_configs = [
97 ":protobuf_config",
98 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
99 "//build/config/compiler:no_size_t_to_int_warning",
100 ]
102 101
103 cflags = protobuf_lite_cflags 102 cflags = protobuf_lite_cflags
104 103
105 # Required for component builds. See http://crbug.com/172800. 104 # Required for component builds. See http://crbug.com/172800.
106 if (component_mode == "shared_library") { 105 if (component_mode == "shared_library") {
107 public_configs += [ ":protobuf_use_dlls" ] 106 public_configs += [ ":protobuf_use_dlls" ]
108 defines = [ "LIBPROTOBUF_EXPORTS" ] 107 defines = [ "LIBPROTOBUF_EXPORTS" ]
109 } 108 }
110 } 109 }
111 110
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 "src/google/protobuf/io/zero_copy_stream_impl.cc", 169 "src/google/protobuf/io/zero_copy_stream_impl.cc",
171 "src/google/protobuf/compiler/importer.cc", 170 "src/google/protobuf/compiler/importer.cc",
172 "src/google/protobuf/compiler/parser.cc", 171 "src/google/protobuf/compiler/parser.cc",
173 ] 172 ]
174 173
175 configs -= [ "//build/config/compiler:chromium_code" ] 174 configs -= [ "//build/config/compiler:chromium_code" ]
176 configs += [ "//build/config/compiler:no_chromium_code" ] 175 configs += [ "//build/config/compiler:no_chromium_code" ]
177 if (is_win) { 176 if (is_win) {
178 configs -= [ "//build/config/win:lean_and_mean" ] 177 configs -= [ "//build/config/win:lean_and_mean" ]
179 } 178 }
180 public_configs = [ ":protobuf_config" ] 179 public_configs = [
180 ":protobuf_config",
181 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
182 "//build/config/compiler:no_size_t_to_int_warning",
183 ]
181 184
182 cflags = protobuf_lite_cflags 185 cflags = protobuf_lite_cflags
183 } 186 }
184 187
185 # Only compile the compiler for the host architecture. 188 # Only compile the compiler for the host architecture.
186 if (current_toolchain == host_toolchain) { 189 if (current_toolchain == host_toolchain) {
187 executable("protoc") { 190 executable("protoc") {
188 sources = [ 191 sources = [
189 "src/google/protobuf/compiler/code_generator.cc", 192 "src/google/protobuf/compiler/code_generator.cc",
190 "src/google/protobuf/compiler/command_line_interface.cc", 193 "src/google/protobuf/compiler/command_line_interface.cc",
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 255 }
253 256
254 cflags = protobuf_lite_cflags 257 cflags = protobuf_lite_cflags
255 258
256 deps = [ 259 deps = [
257 ":protobuf_full", 260 ":protobuf_full",
258 ] 261 ]
259 deps += [ "//build/config/sanitizers:deps" ] 262 deps += [ "//build/config/sanitizers:deps" ]
260 } 263 }
261 } 264 }
OLDNEW
« no previous file with comments | « third_party/libpng/BUILD.gn ('k') | third_party/re2/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698