blob: db99b198f085d70b495f284881d6e04a80249675 [file] [log] [blame]
Primiano Tucciae2879e2017-09-27 11:02:09 +09001# Copyright (C) 2017 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Primiano Tucci7a40e4d2017-12-06 09:51:09 +000015import("//gn/standalone/libc++/libc++.gni")
Florian Mayera2fae262018-08-31 12:10:01 -070016import("../gn/perfetto.gni")
Primiano Tucci0825bc82017-09-28 18:50:23 +010017
Primiano Tucci13ae72f2019-06-06 10:53:02 +010018# This is to make sure that we don't add accidental dependencies from build
19# files in src/ or include/ to buildtools. All deps (outside of /gn/*) should
20# go via the groups defined in gn/BUILD.gn, not directly into buildtools. This
21# is to allow embedders to re-route targets to their third_party directories.
22_buildtools_visibility = [
23 "./*",
24 "../gn:*",
25 "../gn/standalone:*",
26]
27
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010028# Used to suppress warnings coming from googletest macros expansions.
29config("test_warning_suppressions") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +010030 visibility = _buildtools_visibility
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010031 cflags = [
32 "-Wno-unknown-warning-option",
33 "-Wno-global-constructors",
34 "-Wno-covered-switch-default",
35 "-Wno-used-but-marked-unused",
36 "-Wno-covered-switch-default",
37 "-Wno-global-constructors",
38 "-Wno-used-but-marked-unused",
39 "-Wno-inconsistent-missing-override",
40 "-Wno-unused-member-function",
41 "-Wno-zero-as-null-pointer-constant",
42 "-Wno-weak-vtables",
43 ]
44}
45
Primiano Tucci2a29ac72017-10-24 17:47:19 +010046# Mimimal config to be used in production (i.e. non-test) targets. This is
47# really just to allowing include "gtest/gtest_prod.h" for the FRIEND_TEST macro
48# and avoid to pull in warning suppressions that are not really necessary for
49# production code.
50config("googletest_prod_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +010051 visibility = _buildtools_visibility
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010052 cflags = [
53 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
Florian Mayerbda0c442018-09-07 10:53:55 +010054 # warnings coming from third-party headers. Doing so would mask warnings in
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010055 # our own code.
56 "-isystem",
57 rebase_path("googletest/googletest/include", root_build_dir),
58 ]
Primiano Tucci2a29ac72017-10-24 17:47:19 +010059}
60
Florian Mayer475bd7e2018-08-07 20:04:03 +010061config("libunwindstack_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +010062 visibility = _buildtools_visibility
Florian Mayer475bd7e2018-08-07 20:04:03 +010063 cflags = [
64 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
Florian Mayerf8335662018-08-08 11:30:32 +010065 # warnings coming from libunwindstack headers. Doing so would mask warnings
66 # in our own code.
Florian Mayer475bd7e2018-08-07 20:04:03 +010067 "-isystem",
Florian Mayerf8335662018-08-08 11:30:32 +010068 rebase_path("android-core/libunwindstack/include", root_build_dir),
Florian Mayerb64d6b12018-08-30 10:46:30 -070069 "-isystem",
70 rebase_path("android-core/libprocinfo/include", root_build_dir),
71 "-isystem",
72 rebase_path("android-core/base/include", root_build_dir),
Florian Mayer6140f322019-01-21 15:10:17 +000073 "-isystem",
74 rebase_path("android-core/demangle/include", root_build_dir),
Florian Mayer475bd7e2018-08-07 20:04:03 +010075 ]
Florian Mayerb64d6b12018-08-30 10:46:30 -070076 if (is_android) {
77 cflags += [
78 "-isystem",
79 rebase_path("bionic/libc/include", root_build_dir),
80 ]
81 }
Florian Mayer12adafd2019-03-14 21:58:00 -070082 defines = [ "NO_LIBDEXFILE_SUPPORT" ]
Florian Mayer475bd7e2018-08-07 20:04:03 +010083}
84
Primiano Tucci2a29ac72017-10-24 17:47:19 +010085# Config to include gtest.h in test targets.
Primiano Tucciae2879e2017-09-27 11:02:09 +090086config("googletest_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +010087 visibility = _buildtools_visibility
Primiano Tucciae2879e2017-09-27 11:02:09 +090088 defines = [ "GTEST_LANG_CXX11=1" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +090089 cflags = [
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010090 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
Florian Mayerbda0c442018-09-07 10:53:55 +010091 # warnings coming from third-party headers. Doing so would mask warnings in
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010092 # our own code.
93 "-isystem",
94 rebase_path("googletest/googletest/include", root_build_dir),
95 "-isystem",
96 rebase_path("googletest/googlemock/include", root_build_dir),
Primiano Tucciae2879e2017-09-27 11:02:09 +090097 ]
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010098 configs = [ ":test_warning_suppressions" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +090099}
100
101source_set("gtest") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100102 visibility = _buildtools_visibility
Primiano Tucciae2879e2017-09-27 11:02:09 +0900103 testonly = true
104 include_dirs = [ "googletest/googletest" ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000105 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900106 public_configs = [ ":googletest_config" ]
107 all_dependent_configs = [ ":googletest_config" ]
108 sources = [
109 "googletest/googletest/src/gtest-all.cc",
110 ]
111}
112
113source_set("gtest_main") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100114 visibility = _buildtools_visibility
Primiano Tucciae2879e2017-09-27 11:02:09 +0900115 testonly = true
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000116 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900117 configs += [ ":googletest_config" ]
118 sources = [
119 "googletest/googletest/src/gtest_main.cc",
120 ]
121}
122
123source_set("gmock") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100124 visibility = _buildtools_visibility
Primiano Tucciae2879e2017-09-27 11:02:09 +0900125 testonly = true
126 include_dirs = [ "googletest/googlemock" ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000127 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900128 public_configs = [ ":googletest_config" ]
129 all_dependent_configs = [ ":googletest_config" ]
130 sources = [
131 "googletest/googlemock/src/gmock-all.cc",
132 ]
133}
134
Primiano Tuccifd484232017-10-25 00:15:39 +0100135# This config is applied to the autogenerated .pb.{cc,h} files in
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000136# //gn/standalone/proto_library.gni. This config is propagated up to the source sets
Primiano Tuccifd484232017-10-25 00:15:39 +0100137# that depend on generated proto headers. Therefore this should stay as lean and
138# clean as possible in terms of -W-no* suppressions. Thankfully the
139# autogenerated .pb.h headers violate less warnings than the libprotobuf_*
140# library itself.
141config("protobuf_gen_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100142 visibility = [ "*" ] # This is injected by standalone/proto_library.gni
Primiano Tucciae2879e2017-09-27 11:02:09 +0900143 defines = [
144 "GOOGLE_PROTOBUF_NO_RTTI",
145 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900146 ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900147 cflags = [
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100148 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
149 # warnings coming from libprotobuf headers. Doing so would mask warnings in
150 # our own code.
151 "-isystem",
152 rebase_path("protobuf/src", root_build_dir),
153 "-Wno-unknown-warning-option",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900154 "-Wno-deprecated",
Primiano Tuccid7d1be02017-10-30 17:41:34 +0000155 "-Wno-undef",
Primiano Tuccifd484232017-10-25 00:15:39 +0100156 "-Wno-zero-as-null-pointer-constant",
157 ]
Primiano Tuccifd484232017-10-25 00:15:39 +0100158}
159
160# Configuration used to build libprotobuf_* and the protoc compiler.
161config("protobuf_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100162 visibility = _buildtools_visibility
163
Primiano Tuccifd484232017-10-25 00:15:39 +0100164 # Apply the lighter supressions and macro definitions from above.
165 configs = [ ":protobuf_gen_config" ]
166
Primiano Tuccifd484232017-10-25 00:15:39 +0100167 defines = [ "HAVE_PTHREAD=1" ]
Hector Dearmanedb3beb2017-10-09 17:53:36 +0100168 if (is_clang) {
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100169 cflags = [
170 "-Wno-unknown-warning-option",
Primiano Tuccib60d4b02017-11-10 11:03:00 +0000171 "-Wno-enum-compare-switch",
Primiano Tuccib60d4b02017-11-10 11:03:00 +0000172 "-Wno-user-defined-warnings",
Florian Mayeraa5316b2018-08-20 17:45:12 -0700173 "-Wno-tautological-constant-compare",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900174 ]
175 }
176}
177
178source_set("protobuf_lite") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100179 visibility = _buildtools_visibility
Primiano Tucciae2879e2017-09-27 11:02:09 +0900180 sources = [
181 "protobuf/src/google/protobuf/arena.cc",
182 "protobuf/src/google/protobuf/arenastring.cc",
183 "protobuf/src/google/protobuf/extension_set.cc",
184 "protobuf/src/google/protobuf/generated_message_util.cc",
185 "protobuf/src/google/protobuf/io/coded_stream.cc",
186 "protobuf/src/google/protobuf/io/zero_copy_stream.cc",
187 "protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
188 "protobuf/src/google/protobuf/message_lite.cc",
189 "protobuf/src/google/protobuf/repeated_field.cc",
190 "protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
191 "protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc",
192 "protobuf/src/google/protobuf/stubs/bytestream.cc",
193 "protobuf/src/google/protobuf/stubs/common.cc",
194 "protobuf/src/google/protobuf/stubs/int128.cc",
195 "protobuf/src/google/protobuf/stubs/once.cc",
196 "protobuf/src/google/protobuf/stubs/status.cc",
197 "protobuf/src/google/protobuf/stubs/statusor.cc",
198 "protobuf/src/google/protobuf/stubs/stringpiece.cc",
199 "protobuf/src/google/protobuf/stubs/stringprintf.cc",
200 "protobuf/src/google/protobuf/stubs/structurally_valid.cc",
201 "protobuf/src/google/protobuf/stubs/strutil.cc",
202 "protobuf/src/google/protobuf/stubs/time.cc",
203 "protobuf/src/google/protobuf/wire_format_lite.cc",
204 ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000205 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100206 configs += [ ":protobuf_config" ]
207 public_configs = [ ":protobuf_gen_config" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900208}
209
210source_set("protobuf_full") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100211 visibility = _buildtools_visibility
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800212 deps = [
213 ":protobuf_lite",
214 ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900215 sources = [
216 "protobuf/src/google/protobuf/any.cc",
217 "protobuf/src/google/protobuf/any.pb.cc",
218 "protobuf/src/google/protobuf/api.pb.cc",
219 "protobuf/src/google/protobuf/compiler/importer.cc",
220 "protobuf/src/google/protobuf/compiler/parser.cc",
221 "protobuf/src/google/protobuf/descriptor.cc",
222 "protobuf/src/google/protobuf/descriptor.pb.cc",
223 "protobuf/src/google/protobuf/descriptor_database.cc",
224 "protobuf/src/google/protobuf/duration.pb.cc",
225 "protobuf/src/google/protobuf/dynamic_message.cc",
226 "protobuf/src/google/protobuf/empty.pb.cc",
227 "protobuf/src/google/protobuf/extension_set_heavy.cc",
228 "protobuf/src/google/protobuf/field_mask.pb.cc",
229 "protobuf/src/google/protobuf/generated_message_reflection.cc",
230 "protobuf/src/google/protobuf/io/gzip_stream.cc",
231 "protobuf/src/google/protobuf/io/printer.cc",
232 "protobuf/src/google/protobuf/io/strtod.cc",
233 "protobuf/src/google/protobuf/io/tokenizer.cc",
234 "protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc",
235 "protobuf/src/google/protobuf/map_field.cc",
236 "protobuf/src/google/protobuf/message.cc",
237 "protobuf/src/google/protobuf/reflection_ops.cc",
238 "protobuf/src/google/protobuf/service.cc",
239 "protobuf/src/google/protobuf/source_context.pb.cc",
240 "protobuf/src/google/protobuf/struct.pb.cc",
241 "protobuf/src/google/protobuf/stubs/mathlimits.cc",
242 "protobuf/src/google/protobuf/stubs/substitute.cc",
243 "protobuf/src/google/protobuf/text_format.cc",
244 "protobuf/src/google/protobuf/timestamp.pb.cc",
245 "protobuf/src/google/protobuf/type.pb.cc",
246 "protobuf/src/google/protobuf/unknown_field_set.cc",
247 "protobuf/src/google/protobuf/util/field_comparator.cc",
248 "protobuf/src/google/protobuf/util/field_mask_util.cc",
249 "protobuf/src/google/protobuf/util/internal/datapiece.cc",
250 "protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc",
251 "protobuf/src/google/protobuf/util/internal/error_listener.cc",
252 "protobuf/src/google/protobuf/util/internal/field_mask_utility.cc",
253 "protobuf/src/google/protobuf/util/internal/json_escaping.cc",
254 "protobuf/src/google/protobuf/util/internal/json_objectwriter.cc",
255 "protobuf/src/google/protobuf/util/internal/json_stream_parser.cc",
256 "protobuf/src/google/protobuf/util/internal/object_writer.cc",
257 "protobuf/src/google/protobuf/util/internal/proto_writer.cc",
258 "protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc",
259 "protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc",
260 "protobuf/src/google/protobuf/util/internal/type_info.cc",
261 "protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc",
262 "protobuf/src/google/protobuf/util/internal/utility.cc",
263 "protobuf/src/google/protobuf/util/json_util.cc",
264 "protobuf/src/google/protobuf/util/message_differencer.cc",
265 "protobuf/src/google/protobuf/util/time_util.cc",
266 "protobuf/src/google/protobuf/util/type_resolver_util.cc",
267 "protobuf/src/google/protobuf/wire_format.cc",
268 "protobuf/src/google/protobuf/wrappers.pb.cc",
269 ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000270 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100271 configs += [ ":protobuf_config" ]
272 public_configs = [ ":protobuf_gen_config" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900273}
274
275if (current_toolchain == host_toolchain) {
Primiano Tuccifd484232017-10-25 00:15:39 +0100276 source_set("protoc_lib") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100277 visibility = _buildtools_visibility
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800278 deps = [
279 ":protobuf_full",
280 ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900281 sources = [
282 "protobuf/src/google/protobuf/compiler/code_generator.cc",
283 "protobuf/src/google/protobuf/compiler/command_line_interface.cc",
284 "protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc",
285 "protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
286 "protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc",
287 "protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc",
288 "protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc",
289 "protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc",
290 "protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc",
291 "protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc",
292 "protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc",
293 "protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc",
294 "protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
295 "protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
296 "protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
297 "protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
298 "protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc",
299 "protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc",
300 "protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc",
301 "protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc",
302 "protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc",
303 "protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc",
304 "protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc",
305 "protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc",
306 "protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
307 "protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
308 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
309 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
310 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
311 "protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
312 "protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
313 "protobuf/src/google/protobuf/compiler/java/java_context.cc",
314 "protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc",
315 "protobuf/src/google/protobuf/compiler/java/java_enum.cc",
316 "protobuf/src/google/protobuf/compiler/java/java_enum_field.cc",
317 "protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc",
318 "protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc",
319 "protobuf/src/google/protobuf/compiler/java/java_extension.cc",
320 "protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc",
321 "protobuf/src/google/protobuf/compiler/java/java_field.cc",
322 "protobuf/src/google/protobuf/compiler/java/java_file.cc",
323 "protobuf/src/google/protobuf/compiler/java/java_generator.cc",
324 "protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc",
325 "protobuf/src/google/protobuf/compiler/java/java_helpers.cc",
326 "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field.cc",
327 "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc",
328 "protobuf/src/google/protobuf/compiler/java/java_map_field.cc",
329 "protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc",
330 "protobuf/src/google/protobuf/compiler/java/java_message.cc",
331 "protobuf/src/google/protobuf/compiler/java/java_message_builder.cc",
332 "protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc",
333 "protobuf/src/google/protobuf/compiler/java/java_message_field.cc",
334 "protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc",
335 "protobuf/src/google/protobuf/compiler/java/java_message_lite.cc",
336 "protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc",
337 "protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc",
338 "protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc",
339 "protobuf/src/google/protobuf/compiler/java/java_service.cc",
340 "protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc",
341 "protobuf/src/google/protobuf/compiler/java/java_string_field.cc",
342 "protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc",
343 "protobuf/src/google/protobuf/compiler/javanano/javanano_enum.cc",
344 "protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.cc",
345 "protobuf/src/google/protobuf/compiler/javanano/javanano_extension.cc",
346 "protobuf/src/google/protobuf/compiler/javanano/javanano_field.cc",
347 "protobuf/src/google/protobuf/compiler/javanano/javanano_file.cc",
348 "protobuf/src/google/protobuf/compiler/javanano/javanano_generator.cc",
349 "protobuf/src/google/protobuf/compiler/javanano/javanano_helpers.cc",
350 "protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.cc",
351 "protobuf/src/google/protobuf/compiler/javanano/javanano_message.cc",
352 "protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.cc",
353 "protobuf/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc",
354 "protobuf/src/google/protobuf/compiler/js/js_generator.cc",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900355 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
356 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
357 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
358 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc",
359 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc",
360 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
361 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
362 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
363 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc",
364 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
365 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
366 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
367 "protobuf/src/google/protobuf/compiler/plugin.cc",
368 "protobuf/src/google/protobuf/compiler/plugin.pb.cc",
369 "protobuf/src/google/protobuf/compiler/python/python_generator.cc",
370 "protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc",
371 "protobuf/src/google/protobuf/compiler/subprocess.cc",
372 "protobuf/src/google/protobuf/compiler/zip_writer.cc",
373 ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000374 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100375 configs += [ ":protobuf_config" ]
376 public_configs = [ ":protobuf_gen_config" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900377 }
Primiano Tuccifd484232017-10-25 00:15:39 +0100378
379 executable("protoc") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100380 visibility = _buildtools_visibility
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800381 deps = [
382 ":protoc_lib",
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100383 "//gn:default_deps",
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800384 ]
Primiano Tuccifd484232017-10-25 00:15:39 +0100385 sources = [
386 "protobuf/src/google/protobuf/compiler/main.cc",
387 ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000388 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tuccifd484232017-10-25 00:15:39 +0100389 }
Primiano Tucciae2879e2017-09-27 11:02:09 +0900390} # host_toolchain
Primiano Tucci0825bc82017-09-28 18:50:23 +0100391
392if (use_custom_libcxx) {
393 # Config applied to both libc++ and libc++abi targets below.
394 config("libc++config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100395 visibility = _buildtools_visibility
Primiano Tucci0825bc82017-09-28 18:50:23 +0100396 defines = [
397 "LIBCXX_BUILDING_LIBCXXABI",
398 "_LIBCXXABI_NO_EXCEPTIONS",
399 "_LIBCPP_OVERRIDABLE_FUNC_VIS=__attribute__((__visibility__(\"default\")))",
400 ]
401 cflags = [
402 "-fPIC",
403 "-fstrict-aliasing",
404 ]
405 }
406
Primiano Tucci7278dea2017-10-31 11:50:32 +0000407 source_set("libunwind") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100408 visibility = _buildtools_visibility
Primiano Tucci7278dea2017-10-31 11:50:32 +0000409 sources = [
410 "libunwind/src/Unwind-EHABI.cpp",
411 "libunwind/src/Unwind-sjlj.c",
412 "libunwind/src/UnwindLevel1-gcc-ext.c",
413 "libunwind/src/UnwindLevel1.c",
414 "libunwind/src/UnwindRegistersRestore.S",
415 "libunwind/src/UnwindRegistersSave.S",
416 "libunwind/src/libunwind.cpp",
417 ]
418 include_dirs = [ "libunwind/include" ]
419 configs -= [
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000420 "//gn/standalone:extra_warnings",
421 "//gn/standalone:no_exceptions",
422 "//gn/standalone:no_rtti",
Primiano Tucci7278dea2017-10-31 11:50:32 +0000423
424 # When building with msan, libunwind itself triggers memory violations
425 # that causes msan to get stuck into an infinite loop. Just don't
426 # instrument libunwind itself.
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000427 "//gn/standalone/sanitizers:sanitizers_cflags",
Primiano Tucci7278dea2017-10-31 11:50:32 +0000428 ]
429 configs += [
430 ":libc++config",
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000431 "//gn/standalone/sanitizers:sanitizer_options_link_helper",
Primiano Tucci7278dea2017-10-31 11:50:32 +0000432 ]
433 }
434
Primiano Tucci0825bc82017-09-28 18:50:23 +0100435 source_set("libc++abi") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100436 visibility = _buildtools_visibility
Primiano Tucci0825bc82017-09-28 18:50:23 +0100437 sources = [
438 "libcxxabi/src/abort_message.cpp",
439 "libcxxabi/src/cxa_aux_runtime.cpp",
440 "libcxxabi/src/cxa_default_handlers.cpp",
441 "libcxxabi/src/cxa_demangle.cpp",
442 "libcxxabi/src/cxa_exception.cpp",
443 "libcxxabi/src/cxa_exception_storage.cpp",
444 "libcxxabi/src/cxa_guard.cpp",
445 "libcxxabi/src/cxa_handlers.cpp",
446 "libcxxabi/src/cxa_personality.cpp",
447 "libcxxabi/src/cxa_unexpected.cpp",
448 "libcxxabi/src/cxa_vector.cpp",
449 "libcxxabi/src/cxa_virtual.cpp",
450 "libcxxabi/src/fallback_malloc.cpp",
451 "libcxxabi/src/private_typeinfo.cpp",
452 "libcxxabi/src/stdlib_exception.cpp",
453 "libcxxabi/src/stdlib_stdexcept.cpp",
454 "libcxxabi/src/stdlib_typeinfo.cpp",
455 ]
456
457 # On linux this seems to introduce an unwanted glibc 2.18 dependency.
458 if (is_android) {
459 sources += [ "libcxxabi/src/cxa_thread_atexit.cpp" ]
460 }
461 configs -= [
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000462 "//gn/standalone:extra_warnings",
463 "//gn/standalone:no_exceptions",
464 "//gn/standalone:no_rtti",
Primiano Tucci5aab7582017-12-07 12:22:03 +0000465 "//gn/standalone:visibility_hidden",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100466 ]
467 configs += [
468 ":libc++config",
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000469 "//gn/standalone/sanitizers:sanitizer_options_link_helper",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100470 ]
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800471 deps = [
472 ":libunwind",
473 ]
Primiano Tucci0825bc82017-09-28 18:50:23 +0100474 }
475
Primiano Tucci7278dea2017-10-31 11:50:32 +0000476 if (custom_libcxx_is_static) {
477 libcxx_target_type = "source_set"
478 } else {
479 libcxx_target_type = "shared_library"
480 }
481
482 target(libcxx_target_type, "libc++") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100483 visibility = _buildtools_visibility
484 visibility += [ "../gn/standalone/libc++:*" ]
Primiano Tucci0825bc82017-09-28 18:50:23 +0100485 sources = [
486 "libcxx/src/algorithm.cpp",
487 "libcxx/src/any.cpp",
488 "libcxx/src/bind.cpp",
489 "libcxx/src/chrono.cpp",
490 "libcxx/src/condition_variable.cpp",
491 "libcxx/src/debug.cpp",
492 "libcxx/src/exception.cpp",
493 "libcxx/src/functional.cpp",
494 "libcxx/src/future.cpp",
495 "libcxx/src/hash.cpp",
496 "libcxx/src/ios.cpp",
497 "libcxx/src/iostream.cpp",
498 "libcxx/src/locale.cpp",
499 "libcxx/src/memory.cpp",
500 "libcxx/src/mutex.cpp",
501 "libcxx/src/new.cpp",
502 "libcxx/src/optional.cpp",
503 "libcxx/src/random.cpp",
504 "libcxx/src/regex.cpp",
505 "libcxx/src/shared_mutex.cpp",
506 "libcxx/src/stdexcept.cpp",
507 "libcxx/src/string.cpp",
508 "libcxx/src/strstream.cpp",
509 "libcxx/src/system_error.cpp",
510 "libcxx/src/thread.cpp",
511 "libcxx/src/typeinfo.cpp",
512 "libcxx/src/utility.cpp",
513 "libcxx/src/valarray.cpp",
514 "libcxx/src/variant.cpp",
Primiano Tuccic2eb5102018-05-15 10:40:01 +0100515 "libcxx/src/vector.cpp",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100516 ]
517 configs -= [
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000518 "//gn/standalone:extra_warnings",
519 "//gn/standalone:no_exceptions",
520 "//gn/standalone:no_rtti",
Primiano Tucci5aab7582017-12-07 12:22:03 +0000521 "//gn/standalone:visibility_hidden",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100522 ]
523 configs += [
524 ":libc++config",
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000525 "//gn/standalone/sanitizers:sanitizer_options_link_helper",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100526 ]
527 defines = [ "_LIBCPP_BUILDING_LIBRARY" ]
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800528 deps = [
529 ":libc++abi",
530 ]
Primiano Tucci0825bc82017-09-28 18:50:23 +0100531 }
532} # if (use_custom_libcxx)
Hector Dearman88a10112017-10-12 11:07:10 +0100533
534config("benchmark_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100535 visibility = _buildtools_visibility
Primiano Tucci2a29ac72017-10-24 17:47:19 +0100536 include_dirs = [ "benchmark/include" ]
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100537 configs = [ ":test_warning_suppressions" ]
Hector Dearman88a10112017-10-12 11:07:10 +0100538}
539
540source_set("benchmark") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100541 visibility = _buildtools_visibility
Hector Dearman88a10112017-10-12 11:07:10 +0100542 testonly = true
543 sources = [
544 "benchmark/include/benchmark/benchmark.h",
545 "benchmark/include/benchmark/benchmark_api.h",
546 "benchmark/include/benchmark/reporter.h",
547 "benchmark/src/arraysize.h",
548 "benchmark/src/benchmark.cc",
549 "benchmark/src/benchmark_api_internal.h",
550 "benchmark/src/benchmark_register.cc",
551 "benchmark/src/check.h",
552 "benchmark/src/colorprint.cc",
553 "benchmark/src/colorprint.h",
554 "benchmark/src/commandlineflags.cc",
555 "benchmark/src/commandlineflags.h",
556 "benchmark/src/complexity.cc",
557 "benchmark/src/complexity.h",
558 "benchmark/src/console_reporter.cc",
559 "benchmark/src/counter.cc",
560 "benchmark/src/counter.h",
561 "benchmark/src/csv_reporter.cc",
562 "benchmark/src/cycleclock.h",
563 "benchmark/src/internal_macros.h",
564 "benchmark/src/json_reporter.cc",
565 "benchmark/src/log.h",
566 "benchmark/src/mutex.h",
567 "benchmark/src/re.h",
568 "benchmark/src/reporter.cc",
569 "benchmark/src/sleep.cc",
570 "benchmark/src/sleep.h",
Lalit Magantic99d93c2018-03-22 15:09:30 +0000571 "benchmark/src/statistics.cc",
572 "benchmark/src/statistics.h",
Hector Dearman88a10112017-10-12 11:07:10 +0100573 "benchmark/src/string_util.cc",
574 "benchmark/src/string_util.h",
575 "benchmark/src/sysinfo.cc",
576 "benchmark/src/sysinfo.h",
577 "benchmark/src/timers.cc",
578 "benchmark/src/timers.h",
579 ]
580 defines = [ "HAVE_POSIX_REGEX" ]
581 public_configs = [ ":benchmark_config" ]
582 all_dependent_configs = [ ":benchmark_config" ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000583 configs -= [ "//gn/standalone:extra_warnings" ]
Hector Dearman88a10112017-10-12 11:07:10 +0100584}
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200585
586# On Linux/Android use libbacktrace in debug builds for better stacktraces.
587if (is_linux || is_android) {
588 config("libbacktrace_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100589 visibility = _buildtools_visibility
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200590 include_dirs = [
591 "libbacktrace_config",
592 "libbacktrace",
593 ]
594 cflags = [
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100595 # We force include this config file because "config.h" is too generic as a
596 # file name and on some platforms #include "config.h" ends up colliding
597 # importing some other project's config.h.
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200598 "-include",
599 rebase_path("libbacktrace_config/config.h", root_build_dir),
600 ]
601 }
602
603 source_set("libbacktrace") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100604 visibility = _buildtools_visibility
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200605 sources = [
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200606 "libbacktrace/dwarf.c",
607 "libbacktrace/elf.c",
608 "libbacktrace/fileline.c",
609 "libbacktrace/mmap.c",
610 "libbacktrace/mmapio.c",
611 "libbacktrace/posix.c",
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200612 "libbacktrace/sort.c",
613 "libbacktrace/state.c",
614 ]
615 configs -= [ "//gn/standalone:extra_warnings" ]
616 public_configs = [ ":libbacktrace_config" ]
617 }
618}
Lalit Magantib123f262018-05-22 14:05:03 +0100619
620config("sqlite_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100621 visibility = _buildtools_visibility
Lalit Magantib123f262018-05-22 14:05:03 +0100622 include_dirs = [ "sqlite" ]
623 cflags = [
624 "-DSQLITE_THREADSAFE=0",
625 "-DQLITE_DEFAULT_MEMSTATUS=0",
626 "-DSQLITE_LIKE_DOESNT_MATCH_BLOBS",
Lalit Magantib123f262018-05-22 14:05:03 +0100627 "-DSQLITE_OMIT_DEPRECATED",
628 "-DSQLITE_OMIT_SHARED_CACHE",
629 "-DHAVE_USLEEP",
630 "-DHAVE_UTIME",
631 "-DSQLITE_BYTEORDER=1234",
632 "-DSQLITE_DEFAULT_AUTOVACUUM=0",
633 "-DSQLITE_DEFAULT_MMAP_SIZE=0",
634 "-DSQLITE_CORE",
Lalit Maganti8d31c732018-06-21 14:23:04 +0100635 "-DSQLITE_TEMP_STORE=3",
Lalit Magantic6347f02018-06-25 14:03:46 +0100636 "-DSQLITE_OMIT_LOAD_EXTENSION",
Hector Dearman7af33572018-09-19 17:42:25 +0100637 "-DSQLITE_OMIT_RANDOMNESS",
Lalit Magantib123f262018-05-22 14:05:03 +0100638 ]
639}
640
641source_set("sqlite") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100642 visibility = _buildtools_visibility
Lalit Magantib123f262018-05-22 14:05:03 +0100643 sources = [
644 "sqlite/sqlite3.c",
645 "sqlite/sqlite3.h",
646 "sqlite/sqlite3ext.h",
Ioannis Ilkos178535e2018-11-05 17:32:45 +0000647 "sqlite_src/ext/misc/percentile.c",
Lalit Magantib123f262018-05-22 14:05:03 +0100648 ]
649 configs -= [ "//gn/standalone:extra_warnings" ]
650 public_configs = [ ":sqlite_config" ]
651}
652
653source_set("sqlite_shell") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100654 visibility = _buildtools_visibility
Lalit Magantib123f262018-05-22 14:05:03 +0100655 testonly = true
656 sources = [
657 "sqlite/shell.c",
658 ]
659 configs -= [ "//gn/standalone:extra_warnings" ]
660 deps = [
661 ":sqlite",
662 ]
663}
Primiano Tucci0d72a312018-08-07 14:42:45 +0100664
Florian Mayer475bd7e2018-08-07 20:04:03 +0100665source_set("lzma") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100666 visibility = _buildtools_visibility
Florian Mayer475bd7e2018-08-07 20:04:03 +0100667 defines = [ "_7ZIP_ST" ]
668 sources = [
669 "lzma/C/7zAlloc.c",
670 "lzma/C/7zArcIn.c",
671 "lzma/C/7zBuf.c",
672 "lzma/C/7zBuf2.c",
673 "lzma/C/7zCrc.c",
674 "lzma/C/7zCrcOpt.c",
675 "lzma/C/7zDec.c",
676 "lzma/C/7zFile.c",
677 "lzma/C/7zStream.c",
678 "lzma/C/Aes.c",
679 "lzma/C/AesOpt.c",
680 "lzma/C/Alloc.c",
681 "lzma/C/Bcj2.c",
682 "lzma/C/Bra.c",
683 "lzma/C/Bra86.c",
684 "lzma/C/BraIA64.c",
685 "lzma/C/CpuArch.c",
686 "lzma/C/Delta.c",
687 "lzma/C/LzFind.c",
688 "lzma/C/Lzma2Dec.c",
689 "lzma/C/Lzma2Enc.c",
690 "lzma/C/Lzma86Dec.c",
691 "lzma/C/Lzma86Enc.c",
692 "lzma/C/LzmaDec.c",
693 "lzma/C/LzmaEnc.c",
694 "lzma/C/LzmaLib.c",
695 "lzma/C/Ppmd7.c",
696 "lzma/C/Ppmd7Dec.c",
697 "lzma/C/Ppmd7Enc.c",
698 "lzma/C/Sha256.c",
699 "lzma/C/Sort.c",
700 "lzma/C/Xz.c",
701 "lzma/C/XzCrc64.c",
702 "lzma/C/XzCrc64Opt.c",
703 "lzma/C/XzDec.c",
704 "lzma/C/XzEnc.c",
705 "lzma/C/XzIn.c",
706 ]
707 configs -= [ "//gn/standalone:extra_warnings" ]
708 cflags = [
709 "-Wno-empty-body",
710 "-Wno-enum-conversion",
711 ]
712}
Florian Mayera2fae262018-08-31 12:10:01 -0700713
Hector Dearmane0b993f2019-05-24 18:48:16 +0100714source_set("zlib") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100715 visibility = _buildtools_visibility
Hector Dearmane0b993f2019-05-24 18:48:16 +0100716 sources = [
717 "zlib/src/adler32.c",
718 "zlib/src/compress.c",
719 "zlib/src/crc32.c",
720 "zlib/src/deflate.c",
721 "zlib/src/gzclose.c",
722 "zlib/src/gzlib.c",
723 "zlib/src/gzread.c",
724 "zlib/src/gzwrite.c",
725 "zlib/src/infback.c",
726 "zlib/src/inffast.c",
727 "zlib/src/inflate.c",
728 "zlib/src/inftrees.c",
729 "zlib/src/trees.c",
730 "zlib/src/uncompr.c",
731 "zlib/src/zutil.c",
732 ]
733 configs -= [ "//gn/standalone:extra_warnings" ]
734 cflags = []
735 public_configs = [ ":zlib_config" ]
736}
737
738config("zlib_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100739 visibility = _buildtools_visibility
Primiano Tucci225a4e62019-06-06 11:13:57 +0100740 defines = [ "HAVE_HIDDEN" ]
Hector Dearman554627f2019-06-04 17:58:22 +0100741 cflags = [
742 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
743 # warnings coming from third-party headers. Doing so would mask warnings in
744 # our own code.
745 "-isystem",
746 rebase_path("zlib/src", root_build_dir),
747 ]
Hector Dearmane0b993f2019-05-24 18:48:16 +0100748}
749
Florian Mayer475bd7e2018-08-07 20:04:03 +0100750source_set("libunwindstack") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100751 visibility = _buildtools_visibility
Florian Mayer475bd7e2018-08-07 20:04:03 +0100752 include_dirs = [
Florian Mayerf8335662018-08-08 11:30:32 +0100753 "android-core/libunwindstack/include",
754 "android-core/libunwindstack",
755 "android-core/base/include",
756 "android-core/liblog/include",
757 "android-core/libprocinfo/include",
758 "android-core/include",
Florian Mayer475bd7e2018-08-07 20:04:03 +0100759 "lzma/C",
760 ]
761 deps = [
762 ":lzma",
763 ]
Florian Mayer475bd7e2018-08-07 20:04:03 +0100764 sources = [
Florian Mayerf8335662018-08-08 11:30:32 +0100765 "android-core/base/file.cpp",
766 "android-core/base/logging.cpp",
767 "android-core/base/stringprintf.cpp",
768 "android-core/base/strings.cpp",
769 "android-core/base/threads.cpp",
Florian Mayer6140f322019-01-21 15:10:17 +0000770 "android-core/demangle/Demangler.cpp",
Florian Mayerf8335662018-08-08 11:30:32 +0100771 "android-core/libunwindstack/ArmExidx.cpp",
772 "android-core/libunwindstack/DwarfCfa.cpp",
773 "android-core/libunwindstack/DwarfEhFrameWithHdr.cpp",
774 "android-core/libunwindstack/DwarfMemory.cpp",
775 "android-core/libunwindstack/DwarfOp.cpp",
776 "android-core/libunwindstack/DwarfSection.cpp",
777 "android-core/libunwindstack/Elf.cpp",
778 "android-core/libunwindstack/ElfInterface.cpp",
779 "android-core/libunwindstack/ElfInterfaceArm.cpp",
Florian Mayer86120f62018-10-23 15:19:46 +0100780 "android-core/libunwindstack/Global.cpp",
Florian Mayerf8335662018-08-08 11:30:32 +0100781 "android-core/libunwindstack/JitDebug.cpp",
782 "android-core/libunwindstack/LocalUnwinder.cpp",
783 "android-core/libunwindstack/Log.cpp",
784 "android-core/libunwindstack/MapInfo.cpp",
785 "android-core/libunwindstack/Maps.cpp",
786 "android-core/libunwindstack/Memory.cpp",
787 "android-core/libunwindstack/Regs.cpp",
788 "android-core/libunwindstack/RegsArm.cpp",
789 "android-core/libunwindstack/RegsArm64.cpp",
790 "android-core/libunwindstack/RegsMips.cpp",
791 "android-core/libunwindstack/RegsMips64.cpp",
792 "android-core/libunwindstack/RegsX86.cpp",
793 "android-core/libunwindstack/RegsX86_64.cpp",
794 "android-core/libunwindstack/Symbols.cpp",
795 "android-core/libunwindstack/Unwinder.cpp",
796 "android-core/libunwindstack/tests/LogFake.cpp",
Florian Mayer475bd7e2018-08-07 20:04:03 +0100797 ]
798 if (current_cpu == "x86") {
Florian Mayerf8335662018-08-08 11:30:32 +0100799 sources += [ "android-core/libunwindstack/AsmGetRegsX86.S" ]
Florian Mayer475bd7e2018-08-07 20:04:03 +0100800 } else if (current_cpu == "x64") {
Florian Mayerf8335662018-08-08 11:30:32 +0100801 sources += [ "android-core/libunwindstack/AsmGetRegsX86_64.S" ]
Florian Mayer475bd7e2018-08-07 20:04:03 +0100802 }
803 configs -= [
804 "//gn/standalone:extra_warnings",
805 "//gn/standalone:c++11",
Florian Mayera2fae262018-08-31 12:10:01 -0700806 "//gn/standalone:visibility_hidden",
Florian Mayer475bd7e2018-08-07 20:04:03 +0100807 ]
808 configs += [ "//gn/standalone:c++17" ]
809 public_configs = [ ":libunwindstack_config" ]
810}
811
Primiano Tucci0d72a312018-08-07 14:42:45 +0100812config("jsoncpp_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100813 visibility = _buildtools_visibility
Primiano Tucci0d72a312018-08-07 14:42:45 +0100814 cflags = [
815 "-DJSON_USE_EXCEPTION=0",
816
817 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
Florian Mayerbda0c442018-09-07 10:53:55 +0100818 # warnings coming from third-party headers. Doing so would mask warnings in
Primiano Tucci0d72a312018-08-07 14:42:45 +0100819 # our own code.
820 "-isystem",
821 rebase_path("jsoncpp/include", root_build_dir),
822 ]
823}
824
825source_set("jsoncpp") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100826 visibility = _buildtools_visibility
Primiano Tucci0d72a312018-08-07 14:42:45 +0100827 sources = [
828 "jsoncpp/src/lib_json/json_reader.cpp",
829 "jsoncpp/src/lib_json/json_value.cpp",
830 "jsoncpp/src/lib_json/json_writer.cpp",
831 ]
832 configs -= [ "//gn/standalone:extra_warnings" ]
833 public_configs = [ ":jsoncpp_config" ]
834}
Hector Dearmane44ad452018-09-21 11:51:57 +0100835
836config("linenoise_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100837 visibility = _buildtools_visibility
Hector Dearmane44ad452018-09-21 11:51:57 +0100838 cflags = [
839 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
840 # warnings coming from third-party headers. Doing so would mask warnings in
841 # our own code.
842 "-isystem",
843 rebase_path("linenoise", root_build_dir),
844 ]
845}
846
847source_set("linenoise") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100848 visibility = _buildtools_visibility
Hector Dearmane44ad452018-09-21 11:51:57 +0100849 sources = [
850 "linenoise/linenoise.c",
851 "linenoise/linenoise.h",
852 ]
853 configs -= [ "//gn/standalone:extra_warnings" ]
854 public_configs = [ ":linenoise_config" ]
855}
Primiano Tuccia65497e2018-09-26 19:53:58 +0100856
Primiano Tucci780deea2018-10-11 09:28:05 +0100857if (use_libfuzzer) {
858 source_set("libfuzzer") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100859 visibility = _buildtools_visibility
Primiano Tucci780deea2018-10-11 09:28:05 +0100860 configs -= [
861 "//gn/standalone:extra_warnings",
862 "//gn/standalone/sanitizers:sanitizers_cflags",
863 ]
864 sources = [
865 "libfuzzer/FuzzerCrossOver.cpp",
866 "libfuzzer/FuzzerDataFlowTrace.cpp",
867 "libfuzzer/FuzzerDriver.cpp",
868 "libfuzzer/FuzzerExtFunctionsDlsym.cpp",
869 "libfuzzer/FuzzerExtFunctionsWeak.cpp",
870 "libfuzzer/FuzzerExtFunctionsWeakAlias.cpp",
871 "libfuzzer/FuzzerExtraCounters.cpp",
872 "libfuzzer/FuzzerIO.cpp",
873 "libfuzzer/FuzzerIOPosix.cpp",
874 "libfuzzer/FuzzerIOWindows.cpp",
875 "libfuzzer/FuzzerLoop.cpp",
876 "libfuzzer/FuzzerMain.cpp",
877 "libfuzzer/FuzzerMerge.cpp",
878 "libfuzzer/FuzzerMutate.cpp",
879 "libfuzzer/FuzzerSHA1.cpp",
880 "libfuzzer/FuzzerShmemPosix.cpp",
881 "libfuzzer/FuzzerTracePC.cpp",
882 "libfuzzer/FuzzerUtil.cpp",
883 "libfuzzer/FuzzerUtilDarwin.cpp",
884 "libfuzzer/FuzzerUtilFuchsia.cpp",
885 "libfuzzer/FuzzerUtilLinux.cpp",
886 "libfuzzer/FuzzerUtilPosix.cpp",
887 "libfuzzer/FuzzerUtilWindows.cpp",
888 ]
889 }
Primiano Tuccia65497e2018-09-26 19:53:58 +0100890}