OLD | NEW |
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 config("protobuf_config") { | 5 config("protobuf_config") { |
6 include_dirs = [ "src" ] | 6 include_dirs = [ "src" ] |
7 defines = [ | 7 defines = [ |
8 "GOOGLE_PROTOBUF_NO_RTTI", | 8 "GOOGLE_PROTOBUF_NO_RTTI", |
9 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", | 9 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", |
10 ] | 10 ] |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 # This config should be applied to targets using generated code from the proto | 30 # This config should be applied to targets using generated code from the proto |
31 # compiler. It sets up the include directories properly. | 31 # compiler. It sets up the include directories properly. |
32 config("using_proto") { | 32 config("using_proto") { |
33 include_dirs = [ | 33 include_dirs = [ |
34 "src", | 34 "src", |
35 "$root_gen_dir/protoc_out", | 35 "$root_gen_dir/protoc_out", |
36 ] | 36 ] |
37 } | 37 } |
38 | 38 |
39 protobuf_globals_sources = [ | |
40 "src/google/protobuf/globals.cc", | |
41 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", | |
42 ] | |
43 | |
44 protobuf_lite_sources = [ | 39 protobuf_lite_sources = [ |
45 "src/google/protobuf/arena.cc", | 40 "src/google/protobuf/arena.cc", |
46 "src/google/protobuf/arena.h", | 41 "src/google/protobuf/arena.h", |
47 "src/google/protobuf/arenastring.cc", | 42 "src/google/protobuf/arenastring.cc", |
48 "src/google/protobuf/arenastring.h", | 43 "src/google/protobuf/arenastring.h", |
49 "src/google/protobuf/extension_set.cc", | 44 "src/google/protobuf/extension_set.cc", |
50 "src/google/protobuf/extension_set.h", | 45 "src/google/protobuf/extension_set.h", |
51 "src/google/protobuf/generated_message_util.cc", | 46 "src/google/protobuf/generated_message_util.cc", |
52 "src/google/protobuf/generated_message_util.h", | 47 "src/google/protobuf/generated_message_util.h", |
53 "src/google/protobuf/io/coded_stream.cc", | 48 "src/google/protobuf/io/coded_stream.cc", |
(...skipping 17 matching lines...) Expand all Loading... |
71 "src/google/protobuf/stubs/atomicops_internals_arm_qnx.h", | 66 "src/google/protobuf/stubs/atomicops_internals_arm_qnx.h", |
72 "src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h", | 67 "src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h", |
73 "src/google/protobuf/stubs/atomicops_internals_generic_gcc.h", | 68 "src/google/protobuf/stubs/atomicops_internals_generic_gcc.h", |
74 "src/google/protobuf/stubs/atomicops_internals_macosx.h", | 69 "src/google/protobuf/stubs/atomicops_internals_macosx.h", |
75 "src/google/protobuf/stubs/atomicops_internals_mips_gcc.h", | 70 "src/google/protobuf/stubs/atomicops_internals_mips_gcc.h", |
76 "src/google/protobuf/stubs/atomicops_internals_pnacl.h", | 71 "src/google/protobuf/stubs/atomicops_internals_pnacl.h", |
77 "src/google/protobuf/stubs/atomicops_internals_power.h", | 72 "src/google/protobuf/stubs/atomicops_internals_power.h", |
78 "src/google/protobuf/stubs/atomicops_internals_ppc_gcc.h", | 73 "src/google/protobuf/stubs/atomicops_internals_ppc_gcc.h", |
79 "src/google/protobuf/stubs/atomicops_internals_solaris.h", | 74 "src/google/protobuf/stubs/atomicops_internals_solaris.h", |
80 "src/google/protobuf/stubs/atomicops_internals_tsan.h", | 75 "src/google/protobuf/stubs/atomicops_internals_tsan.h", |
| 76 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", |
81 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h", | 77 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h", |
82 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", | 78 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", |
83 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h", | 79 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h", |
84 "src/google/protobuf/stubs/atomic_sequence_num.h", | 80 "src/google/protobuf/stubs/atomic_sequence_num.h", |
85 "src/google/protobuf/stubs/bytestream.cc", | 81 "src/google/protobuf/stubs/bytestream.cc", |
86 "src/google/protobuf/stubs/bytestream.h", | 82 "src/google/protobuf/stubs/bytestream.h", |
87 "src/google/protobuf/stubs/callback.h", | 83 "src/google/protobuf/stubs/callback.h", |
88 "src/google/protobuf/stubs/casts.h", | 84 "src/google/protobuf/stubs/casts.h", |
89 "src/google/protobuf/stubs/common.cc", | 85 "src/google/protobuf/stubs/common.cc", |
90 "src/google/protobuf/stubs/common.h", | 86 "src/google/protobuf/stubs/common.h", |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 "/wd4715", # not all control paths return a value (fixed in trunk) | 135 "/wd4715", # not all control paths return a value (fixed in trunk) |
140 ] | 136 ] |
141 } | 137 } |
142 | 138 |
143 # Do not allow libprotobuf_lite to be dynamically linked on Linux. Later | 139 # Do not allow libprotobuf_lite to be dynamically linked on Linux. Later |
144 # versions of Ubuntu like Xenial and Yakkety link in the system | 140 # versions of Ubuntu like Xenial and Yakkety link in the system |
145 # libprotobuf_lite by the following dependency chain: chrome -> gtk -> | 141 # libprotobuf_lite by the following dependency chain: chrome -> gtk -> |
146 # libmirclient -> libmirprotobuf -> libprotobuf-lite. Trying to load | 142 # libmirclient -> libmirprotobuf -> libprotobuf-lite. Trying to load |
147 # the system libprotobuf-lite after already having loaded the libprotobuf_lite | 143 # the system libprotobuf-lite after already having loaded the libprotobuf_lite |
148 # component will result in an immediate crash. (crbug.com/700120) | 144 # component will result in an immediate crash. (crbug.com/700120) |
149 if (is_linux && !is_chromeos) { | 145 if (is_component_build && is_desktop_linux) { |
150 link_target_type = "static_library" | 146 shared_library("mirclient") { |
151 } else { | 147 inputs = [ |
152 link_target_type = "component" | 148 "mirclient.map", |
153 } | |
154 | |
155 if (is_component_build && is_linux && !is_chromeos) { | |
156 # Even though protobuf is statically linked on Linux, global data must | |
157 # be shared across different copies of the library in each component. | |
158 # protobuf_globals is a shared library that provides this state, but is | |
159 # careful to prefix all exported symbols with 'cr_' so they don't conflict | |
160 # with other versions of protobuf. | |
161 component("protobuf_globals") { | |
162 configs += [ | |
163 ":protobuf_config", | |
164 ":protobuf_use_dlls", | |
165 ] | 149 ] |
166 defines = [ "LIBPROTOBUF_EXPORTS" ] | 150 sources = [ |
167 sources = protobuf_globals_sources | 151 "mirclient.cc", |
| 152 ] |
| 153 ldflags = [ "-Wl,--version-script=" + |
| 154 rebase_path("//third_party/protobuf/mirclient.map") ] |
| 155 output_extension = "so.9" |
168 } | 156 } |
169 } | 157 } |
170 | 158 |
171 target(link_target_type, "protobuf_lite") { | 159 component("protobuf_lite") { |
172 sources = protobuf_lite_sources | 160 sources = protobuf_lite_sources |
173 | 161 |
174 configs -= [ "//build/config/compiler:chromium_code" ] | 162 configs -= [ "//build/config/compiler:chromium_code" ] |
175 configs += [ | 163 configs += [ |
176 "//build/config/compiler:no_chromium_code", | 164 "//build/config/compiler:no_chromium_code", |
177 | 165 |
178 # Must be after no_chromium_code for warning flags to be ordered | 166 # Must be after no_chromium_code for warning flags to be ordered |
179 # correctly. | 167 # correctly. |
180 ":protobuf_warnings", | 168 ":protobuf_warnings", |
181 ] | 169 ] |
182 | 170 |
183 if (is_win) { | 171 if (is_win) { |
184 configs -= [ "//build/config/win:lean_and_mean" ] | 172 configs -= [ "//build/config/win:lean_and_mean" ] |
185 } | 173 } |
186 | 174 |
187 public_configs = [ | 175 public_configs = [ |
188 ":protobuf_config", | 176 ":protobuf_config", |
189 | 177 |
190 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 178 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
191 "//build/config/compiler:no_size_t_to_int_warning", | 179 "//build/config/compiler:no_size_t_to_int_warning", |
192 ] | 180 ] |
193 | 181 |
194 deps = [ | 182 deps = [ |
195 "//build/config/sanitizers:deps", | 183 "//build/config/sanitizers:deps", |
196 ] | 184 ] |
197 | 185 |
198 cflags = protobuf_lite_cflags | 186 cflags = protobuf_lite_cflags |
199 | 187 |
200 if (is_component_build && is_linux && !is_chromeos) { | 188 if (is_component_build && is_desktop_linux) { |
201 deps += [ ":protobuf_globals" ] | 189 deps += [ ":mirclient" ] |
202 } else { | |
203 sources += protobuf_globals_sources | |
204 } | 190 } |
205 | 191 |
206 # Required for component builds. See http://crbug.com/172800. | 192 # Required for component builds. See http://crbug.com/172800. |
207 if (is_component_build) { | 193 if (is_component_build) { |
208 public_configs += [ ":protobuf_use_dlls" ] | 194 public_configs += [ ":protobuf_use_dlls" ] |
209 if (!is_linux || is_chromeos) { | 195 defines = [ "LIBPROTOBUF_EXPORTS" ] |
210 defines = [ "LIBPROTOBUF_EXPORTS" ] | |
211 } | |
212 } | 196 } |
213 } | 197 } |
214 | 198 |
215 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't | 199 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't |
216 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls | 200 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls |
217 # into that category. Do not use in Chrome code. | 201 # into that category. Do not use in Chrome code. |
218 static_library("protobuf_full") { | 202 static_library("protobuf_full") { |
219 # Prevent people from depending on this outside our file. | 203 # Prevent people from depending on this outside our file. |
220 visibility = [ | 204 visibility = [ |
221 ":*", | 205 ":*", |
222 | 206 |
223 # requires descriptors & reflection; testonly. | 207 # requires descriptors & reflection; testonly. |
224 "//third_party/libprotobuf-mutator:*", | 208 "//third_party/libprotobuf-mutator:*", |
225 | 209 |
226 # The traffic_annotation tool is not part of Chrome itself, and needs to | 210 # The traffic_annotation tool is not part of Chrome itself, and needs to |
227 # parse human-readable protobufs. | 211 # parse human-readable protobufs. |
228 "//tools/traffic_annotation/*", | 212 "//tools/traffic_annotation/*", |
229 ] | 213 ] |
230 | 214 |
231 sources = protobuf_lite_sources + protobuf_globals_sources + [ | 215 sources = protobuf_lite_sources + [ |
232 "src/google/protobuf/any.cc", | 216 "src/google/protobuf/any.cc", |
233 "src/google/protobuf/any.h", | 217 "src/google/protobuf/any.h", |
234 "src/google/protobuf/any.pb.cc", | 218 "src/google/protobuf/any.pb.cc", |
235 "src/google/protobuf/any.pb.h", | 219 "src/google/protobuf/any.pb.h", |
236 "src/google/protobuf/api.pb.cc", | 220 "src/google/protobuf/api.pb.cc", |
237 "src/google/protobuf/api.pb.h", | 221 "src/google/protobuf/api.pb.h", |
238 "src/google/protobuf/compiler/importer.cc", | 222 "src/google/protobuf/compiler/importer.cc", |
239 "src/google/protobuf/compiler/importer.h", | 223 "src/google/protobuf/compiler/importer.h", |
240 "src/google/protobuf/compiler/parser.cc", | 224 "src/google/protobuf/compiler/parser.cc", |
241 "src/google/protobuf/compiler/parser.h", | 225 "src/google/protobuf/compiler/parser.h", |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 ":copy_google_protobuf_internal", | 675 ":copy_google_protobuf_internal", |
692 ":copy_six", | 676 ":copy_six", |
693 ] | 677 ] |
694 | 678 |
695 # Targets that depend on this should depend on the copied data files. | 679 # Targets that depend on this should depend on the copied data files. |
696 data = get_target_outputs(":copy_google") | 680 data = get_target_outputs(":copy_google") |
697 data += get_target_outputs(":copy_six") | 681 data += get_target_outputs(":copy_six") |
698 data += get_target_outputs(":copy_google_protobuf") | 682 data += get_target_outputs(":copy_google_protobuf") |
699 data += get_target_outputs(":copy_google_protobuf_internal") | 683 data += get_target_outputs(":copy_google_protobuf_internal") |
700 } | 684 } |
OLD | NEW |