blob: 6407efe64737e41f51b1b0bbd5be1743e5240022 [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 Tucci7278dea2017-10-31 11:50:32 +000015import("//build/libc++/libc++.gni")
Primiano Tucci0825bc82017-09-28 18:50:23 +010016
Primiano Tucci2a29ac72017-10-24 17:47:19 +010017# Mimimal config to be used in production (i.e. non-test) targets. This is
18# really just to allowing include "gtest/gtest_prod.h" for the FRIEND_TEST macro
19# and avoid to pull in warning suppressions that are not really necessary for
20# production code.
21config("googletest_prod_config") {
22 visibility = [ ":*" ]
23 include_dirs = [ "googletest/googletest/include" ]
24}
25
26# Config to include gtest.h in test targets.
Primiano Tucciae2879e2017-09-27 11:02:09 +090027config("googletest_config") {
28 visibility = [ ":*" ]
29 defines = [ "GTEST_LANG_CXX11=1" ]
30 include_dirs = [
31 "googletest/googletest/include",
32 "googletest/googlemock/include",
33 ]
34 cflags = [
Primiano Tucci13331342017-10-25 17:08:13 +010035 "-Wno-covered-switch-default",
Primiano Tucciae2879e2017-09-27 11:02:09 +090036 "-Wno-deprecated",
37 "-Wno-global-constructors",
Primiano Tuccice720022017-10-30 12:50:06 +000038 "-Wno-inconsistent-missing-override",
Primiano Tucciae2879e2017-09-27 11:02:09 +090039 "-Wno-missing-noreturn",
40 "-Wno-shift-sign-overflow",
Primiano Tuccice720022017-10-30 12:50:06 +000041 "-Wno-sign-conversion",
Primiano Tucciae2879e2017-09-27 11:02:09 +090042 "-Wno-undef",
Primiano Tuccice720022017-10-30 12:50:06 +000043 "-Wno-unused-member-function",
Primiano Tucciae2879e2017-09-27 11:02:09 +090044 "-Wno-used-but-marked-unused",
Primiano Tuccifd484232017-10-25 00:15:39 +010045 "-Wno-zero-as-null-pointer-constant",
Primiano Tucciae2879e2017-09-27 11:02:09 +090046 ]
47}
48
49source_set("gtest") {
50 testonly = true
51 include_dirs = [ "googletest/googletest" ]
52 configs -= [ "//build:extra_warnings" ]
53 public_configs = [ ":googletest_config" ]
54 all_dependent_configs = [ ":googletest_config" ]
55 sources = [
56 "googletest/googletest/src/gtest-all.cc",
57 ]
58}
59
60source_set("gtest_main") {
61 testonly = true
62 configs -= [ "//build:extra_warnings" ]
63 configs += [ ":googletest_config" ]
64 sources = [
65 "googletest/googletest/src/gtest_main.cc",
66 ]
67}
68
69source_set("gmock") {
70 testonly = true
71 include_dirs = [ "googletest/googlemock" ]
72 configs -= [ "//build:extra_warnings" ]
73 public_configs = [ ":googletest_config" ]
74 all_dependent_configs = [ ":googletest_config" ]
75 sources = [
76 "googletest/googlemock/src/gmock-all.cc",
77 ]
78}
79
Primiano Tuccifd484232017-10-25 00:15:39 +010080# This config is applied to the autogenerated .pb.{cc,h} files in
81# //build/proto_library.gni. This config is propagated up to the source sets
82# that depend on generated proto headers. Therefore this should stay as lean and
83# clean as possible in terms of -W-no* suppressions. Thankfully the
84# autogenerated .pb.h headers violate less warnings than the libprotobuf_*
85# library itself.
86config("protobuf_gen_config") {
Primiano Tucciae2879e2017-09-27 11:02:09 +090087 visibility = [ ":*" ]
88 defines = [
89 "GOOGLE_PROTOBUF_NO_RTTI",
90 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
Primiano Tucciae2879e2017-09-27 11:02:09 +090091 ]
Primiano Tuccifd484232017-10-25 00:15:39 +010092 include_dirs = [ "protobuf/src" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +090093 cflags = [
94 "-Wno-deprecated",
Primiano Tuccifd484232017-10-25 00:15:39 +010095 "-Wno-disabled-macro-expansion",
Primiano Tuccid7d1be02017-10-30 17:41:34 +000096 "-Wno-int-to-void-pointer-cast",
Primiano Tuccifd484232017-10-25 00:15:39 +010097 "-Wno-missing-variable-declarations",
98 "-Wno-old-style-cast",
Primiano Tuccid7d1be02017-10-30 17:41:34 +000099 "-Wno-shorten-64-to-32",
Primiano Tuccifd484232017-10-25 00:15:39 +0100100 "-Wno-sign-compare",
Primiano Tuccid7d1be02017-10-30 17:41:34 +0000101 "-Wno-sign-conversion",
102 "-Wno-undef",
Primiano Tuccifd484232017-10-25 00:15:39 +0100103 "-Wno-zero-as-null-pointer-constant",
104 ]
Primiano Tuccifd484232017-10-25 00:15:39 +0100105}
106
107# Configuration used to build libprotobuf_* and the protoc compiler.
108config("protobuf_config") {
109 # Apply the lighter supressions and macro definitions from above.
110 configs = [ ":protobuf_gen_config" ]
111
112 visibility = [ ":*" ]
113 defines = [ "HAVE_PTHREAD=1" ]
114 cflags = [
115 "-Wno-ignored-qualifiers",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900116 "-Wno-missing-noreturn",
117 "-Wno-undef",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900118 "-Wno-unused-parameter",
119 "-Wno-unused",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900120 ]
Hector Dearmanedb3beb2017-10-09 17:53:36 +0100121 if (is_clang) {
Primiano Tucciae2879e2017-09-27 11:02:09 +0900122 cflags += [
Primiano Tuccib60d4b02017-11-10 11:03:00 +0000123 "-Wno-enum-compare-switch",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900124 "-Wno-global-constructors",
Primiano Tuccib60d4b02017-11-10 11:03:00 +0000125 "-Wno-shift-sign-overflow",
126 "-Wno-used-but-marked-unused",
127 "-Wno-user-defined-warnings",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900128 ]
Hector Dearmanedb3beb2017-10-09 17:53:36 +0100129 } else {
130 cflags += [
131 "-Wno-misleading-indentation",
132 "-Wno-return-type",
133 ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900134 }
135}
136
137source_set("protobuf_lite") {
138 sources = [
139 "protobuf/src/google/protobuf/arena.cc",
140 "protobuf/src/google/protobuf/arenastring.cc",
141 "protobuf/src/google/protobuf/extension_set.cc",
142 "protobuf/src/google/protobuf/generated_message_util.cc",
143 "protobuf/src/google/protobuf/io/coded_stream.cc",
144 "protobuf/src/google/protobuf/io/zero_copy_stream.cc",
145 "protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
146 "protobuf/src/google/protobuf/message_lite.cc",
147 "protobuf/src/google/protobuf/repeated_field.cc",
148 "protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
149 "protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc",
150 "protobuf/src/google/protobuf/stubs/bytestream.cc",
151 "protobuf/src/google/protobuf/stubs/common.cc",
152 "protobuf/src/google/protobuf/stubs/int128.cc",
153 "protobuf/src/google/protobuf/stubs/once.cc",
154 "protobuf/src/google/protobuf/stubs/status.cc",
155 "protobuf/src/google/protobuf/stubs/statusor.cc",
156 "protobuf/src/google/protobuf/stubs/stringpiece.cc",
157 "protobuf/src/google/protobuf/stubs/stringprintf.cc",
158 "protobuf/src/google/protobuf/stubs/structurally_valid.cc",
159 "protobuf/src/google/protobuf/stubs/strutil.cc",
160 "protobuf/src/google/protobuf/stubs/time.cc",
161 "protobuf/src/google/protobuf/wire_format_lite.cc",
162 ]
163 configs -= [ "//build:extra_warnings" ]
164 public_configs = [ ":protobuf_config" ]
165}
166
167source_set("protobuf_full") {
Primiano Tucci0825bc82017-09-28 18:50:23 +0100168 deps += [ ":protobuf_lite" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900169 sources = [
170 "protobuf/src/google/protobuf/any.cc",
171 "protobuf/src/google/protobuf/any.pb.cc",
172 "protobuf/src/google/protobuf/api.pb.cc",
173 "protobuf/src/google/protobuf/compiler/importer.cc",
174 "protobuf/src/google/protobuf/compiler/parser.cc",
175 "protobuf/src/google/protobuf/descriptor.cc",
176 "protobuf/src/google/protobuf/descriptor.pb.cc",
177 "protobuf/src/google/protobuf/descriptor_database.cc",
178 "protobuf/src/google/protobuf/duration.pb.cc",
179 "protobuf/src/google/protobuf/dynamic_message.cc",
180 "protobuf/src/google/protobuf/empty.pb.cc",
181 "protobuf/src/google/protobuf/extension_set_heavy.cc",
182 "protobuf/src/google/protobuf/field_mask.pb.cc",
183 "protobuf/src/google/protobuf/generated_message_reflection.cc",
184 "protobuf/src/google/protobuf/io/gzip_stream.cc",
185 "protobuf/src/google/protobuf/io/printer.cc",
186 "protobuf/src/google/protobuf/io/strtod.cc",
187 "protobuf/src/google/protobuf/io/tokenizer.cc",
188 "protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc",
189 "protobuf/src/google/protobuf/map_field.cc",
190 "protobuf/src/google/protobuf/message.cc",
191 "protobuf/src/google/protobuf/reflection_ops.cc",
192 "protobuf/src/google/protobuf/service.cc",
193 "protobuf/src/google/protobuf/source_context.pb.cc",
194 "protobuf/src/google/protobuf/struct.pb.cc",
195 "protobuf/src/google/protobuf/stubs/mathlimits.cc",
196 "protobuf/src/google/protobuf/stubs/substitute.cc",
197 "protobuf/src/google/protobuf/text_format.cc",
198 "protobuf/src/google/protobuf/timestamp.pb.cc",
199 "protobuf/src/google/protobuf/type.pb.cc",
200 "protobuf/src/google/protobuf/unknown_field_set.cc",
201 "protobuf/src/google/protobuf/util/field_comparator.cc",
202 "protobuf/src/google/protobuf/util/field_mask_util.cc",
203 "protobuf/src/google/protobuf/util/internal/datapiece.cc",
204 "protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc",
205 "protobuf/src/google/protobuf/util/internal/error_listener.cc",
206 "protobuf/src/google/protobuf/util/internal/field_mask_utility.cc",
207 "protobuf/src/google/protobuf/util/internal/json_escaping.cc",
208 "protobuf/src/google/protobuf/util/internal/json_objectwriter.cc",
209 "protobuf/src/google/protobuf/util/internal/json_stream_parser.cc",
210 "protobuf/src/google/protobuf/util/internal/object_writer.cc",
211 "protobuf/src/google/protobuf/util/internal/proto_writer.cc",
212 "protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc",
213 "protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc",
214 "protobuf/src/google/protobuf/util/internal/type_info.cc",
215 "protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc",
216 "protobuf/src/google/protobuf/util/internal/utility.cc",
217 "protobuf/src/google/protobuf/util/json_util.cc",
218 "protobuf/src/google/protobuf/util/message_differencer.cc",
219 "protobuf/src/google/protobuf/util/time_util.cc",
220 "protobuf/src/google/protobuf/util/type_resolver_util.cc",
221 "protobuf/src/google/protobuf/wire_format.cc",
222 "protobuf/src/google/protobuf/wrappers.pb.cc",
223 ]
224 configs -= [ "//build:extra_warnings" ]
225 public_configs = [ ":protobuf_config" ]
226}
227
228if (current_toolchain == host_toolchain) {
Primiano Tuccifd484232017-10-25 00:15:39 +0100229 source_set("protoc_lib") {
Primiano Tucci0825bc82017-09-28 18:50:23 +0100230 deps += [ ":protobuf_full" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900231 sources = [
232 "protobuf/src/google/protobuf/compiler/code_generator.cc",
233 "protobuf/src/google/protobuf/compiler/command_line_interface.cc",
234 "protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc",
235 "protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
236 "protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc",
237 "protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc",
238 "protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc",
239 "protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc",
240 "protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc",
241 "protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc",
242 "protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc",
243 "protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc",
244 "protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
245 "protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
246 "protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
247 "protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
248 "protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc",
249 "protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc",
250 "protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc",
251 "protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc",
252 "protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc",
253 "protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc",
254 "protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc",
255 "protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc",
256 "protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
257 "protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
258 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
259 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
260 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
261 "protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
262 "protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
263 "protobuf/src/google/protobuf/compiler/java/java_context.cc",
264 "protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc",
265 "protobuf/src/google/protobuf/compiler/java/java_enum.cc",
266 "protobuf/src/google/protobuf/compiler/java/java_enum_field.cc",
267 "protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc",
268 "protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc",
269 "protobuf/src/google/protobuf/compiler/java/java_extension.cc",
270 "protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc",
271 "protobuf/src/google/protobuf/compiler/java/java_field.cc",
272 "protobuf/src/google/protobuf/compiler/java/java_file.cc",
273 "protobuf/src/google/protobuf/compiler/java/java_generator.cc",
274 "protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc",
275 "protobuf/src/google/protobuf/compiler/java/java_helpers.cc",
276 "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field.cc",
277 "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc",
278 "protobuf/src/google/protobuf/compiler/java/java_map_field.cc",
279 "protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc",
280 "protobuf/src/google/protobuf/compiler/java/java_message.cc",
281 "protobuf/src/google/protobuf/compiler/java/java_message_builder.cc",
282 "protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc",
283 "protobuf/src/google/protobuf/compiler/java/java_message_field.cc",
284 "protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc",
285 "protobuf/src/google/protobuf/compiler/java/java_message_lite.cc",
286 "protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc",
287 "protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc",
288 "protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc",
289 "protobuf/src/google/protobuf/compiler/java/java_service.cc",
290 "protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc",
291 "protobuf/src/google/protobuf/compiler/java/java_string_field.cc",
292 "protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc",
293 "protobuf/src/google/protobuf/compiler/javanano/javanano_enum.cc",
294 "protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.cc",
295 "protobuf/src/google/protobuf/compiler/javanano/javanano_extension.cc",
296 "protobuf/src/google/protobuf/compiler/javanano/javanano_field.cc",
297 "protobuf/src/google/protobuf/compiler/javanano/javanano_file.cc",
298 "protobuf/src/google/protobuf/compiler/javanano/javanano_generator.cc",
299 "protobuf/src/google/protobuf/compiler/javanano/javanano_helpers.cc",
300 "protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.cc",
301 "protobuf/src/google/protobuf/compiler/javanano/javanano_message.cc",
302 "protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.cc",
303 "protobuf/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc",
304 "protobuf/src/google/protobuf/compiler/js/js_generator.cc",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900305 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
306 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
307 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
308 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc",
309 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc",
310 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
311 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
312 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
313 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc",
314 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
315 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
316 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
317 "protobuf/src/google/protobuf/compiler/plugin.cc",
318 "protobuf/src/google/protobuf/compiler/plugin.pb.cc",
319 "protobuf/src/google/protobuf/compiler/python/python_generator.cc",
320 "protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc",
321 "protobuf/src/google/protobuf/compiler/subprocess.cc",
322 "protobuf/src/google/protobuf/compiler/zip_writer.cc",
323 ]
324 configs -= [ "//build:extra_warnings" ]
325 public_configs = [ ":protobuf_config" ]
326 }
Primiano Tuccifd484232017-10-25 00:15:39 +0100327
328 executable("protoc") {
329 deps += [ ":protoc_lib" ]
330 sources = [
331 "protobuf/src/google/protobuf/compiler/main.cc",
332 ]
333 configs -= [ "//build:extra_warnings" ]
334 }
Primiano Tucciae2879e2017-09-27 11:02:09 +0900335} # host_toolchain
Primiano Tucci0825bc82017-09-28 18:50:23 +0100336
337if (use_custom_libcxx) {
338 # Config applied to both libc++ and libc++abi targets below.
339 config("libc++config") {
340 defines = [
341 "LIBCXX_BUILDING_LIBCXXABI",
342 "_LIBCXXABI_NO_EXCEPTIONS",
343 "_LIBCPP_OVERRIDABLE_FUNC_VIS=__attribute__((__visibility__(\"default\")))",
344 ]
345 cflags = [
346 "-fPIC",
347 "-fstrict-aliasing",
348 ]
349 }
350
Primiano Tucci7278dea2017-10-31 11:50:32 +0000351 source_set("libunwind") {
352 sources = [
353 "libunwind/src/Unwind-EHABI.cpp",
354 "libunwind/src/Unwind-sjlj.c",
355 "libunwind/src/UnwindLevel1-gcc-ext.c",
356 "libunwind/src/UnwindLevel1.c",
357 "libunwind/src/UnwindRegistersRestore.S",
358 "libunwind/src/UnwindRegistersSave.S",
359 "libunwind/src/libunwind.cpp",
360 ]
361 include_dirs = [ "libunwind/include" ]
362 configs -= [
363 "//build:extra_warnings",
364 "//build:no_exceptions",
365 "//build:no_rtti",
366
367 # When building with msan, libunwind itself triggers memory violations
368 # that causes msan to get stuck into an infinite loop. Just don't
369 # instrument libunwind itself.
370 "//build/sanitizers:sanitizers_cflags",
371 ]
372 configs += [
373 ":libc++config",
374 "//build/sanitizers:sanitizer_options_link_helper",
375 ]
376 }
377
Primiano Tucci0825bc82017-09-28 18:50:23 +0100378 source_set("libc++abi") {
379 sources = [
380 "libcxxabi/src/abort_message.cpp",
381 "libcxxabi/src/cxa_aux_runtime.cpp",
382 "libcxxabi/src/cxa_default_handlers.cpp",
383 "libcxxabi/src/cxa_demangle.cpp",
384 "libcxxabi/src/cxa_exception.cpp",
385 "libcxxabi/src/cxa_exception_storage.cpp",
386 "libcxxabi/src/cxa_guard.cpp",
387 "libcxxabi/src/cxa_handlers.cpp",
388 "libcxxabi/src/cxa_personality.cpp",
389 "libcxxabi/src/cxa_unexpected.cpp",
390 "libcxxabi/src/cxa_vector.cpp",
391 "libcxxabi/src/cxa_virtual.cpp",
392 "libcxxabi/src/fallback_malloc.cpp",
393 "libcxxabi/src/private_typeinfo.cpp",
394 "libcxxabi/src/stdlib_exception.cpp",
395 "libcxxabi/src/stdlib_stdexcept.cpp",
396 "libcxxabi/src/stdlib_typeinfo.cpp",
397 ]
398
399 # On linux this seems to introduce an unwanted glibc 2.18 dependency.
400 if (is_android) {
401 sources += [ "libcxxabi/src/cxa_thread_atexit.cpp" ]
402 }
403 configs -= [
404 "//build:extra_warnings",
405 "//build:no_exceptions",
406 "//build:no_rtti",
407 ]
408 configs += [
409 ":libc++config",
410 "//build/sanitizers:sanitizer_options_link_helper",
411 ]
Primiano Tucci7278dea2017-10-31 11:50:32 +0000412 deps += [ ":libunwind" ]
Primiano Tucci0825bc82017-09-28 18:50:23 +0100413 }
414
Primiano Tucci7278dea2017-10-31 11:50:32 +0000415 if (custom_libcxx_is_static) {
416 libcxx_target_type = "source_set"
417 } else {
418 libcxx_target_type = "shared_library"
419 }
420
421 target(libcxx_target_type, "libc++") {
Primiano Tucci0825bc82017-09-28 18:50:23 +0100422 sources = [
423 "libcxx/src/algorithm.cpp",
424 "libcxx/src/any.cpp",
425 "libcxx/src/bind.cpp",
426 "libcxx/src/chrono.cpp",
427 "libcxx/src/condition_variable.cpp",
428 "libcxx/src/debug.cpp",
429 "libcxx/src/exception.cpp",
430 "libcxx/src/functional.cpp",
431 "libcxx/src/future.cpp",
432 "libcxx/src/hash.cpp",
433 "libcxx/src/ios.cpp",
434 "libcxx/src/iostream.cpp",
435 "libcxx/src/locale.cpp",
436 "libcxx/src/memory.cpp",
437 "libcxx/src/mutex.cpp",
438 "libcxx/src/new.cpp",
439 "libcxx/src/optional.cpp",
440 "libcxx/src/random.cpp",
441 "libcxx/src/regex.cpp",
442 "libcxx/src/shared_mutex.cpp",
443 "libcxx/src/stdexcept.cpp",
444 "libcxx/src/string.cpp",
445 "libcxx/src/strstream.cpp",
446 "libcxx/src/system_error.cpp",
447 "libcxx/src/thread.cpp",
448 "libcxx/src/typeinfo.cpp",
449 "libcxx/src/utility.cpp",
450 "libcxx/src/valarray.cpp",
451 "libcxx/src/variant.cpp",
452 ]
453 configs -= [
454 "//build:extra_warnings",
455 "//build:no_exceptions",
456 "//build:no_rtti",
457 ]
458 configs += [
459 ":libc++config",
460 "//build/sanitizers:sanitizer_options_link_helper",
461 ]
462 defines = [ "_LIBCPP_BUILDING_LIBRARY" ]
Primiano Tucci7278dea2017-10-31 11:50:32 +0000463 deps += [ ":libc++abi" ]
Primiano Tucci0825bc82017-09-28 18:50:23 +0100464 }
465} # if (use_custom_libcxx)
Hector Dearman88a10112017-10-12 11:07:10 +0100466
467config("benchmark_config") {
468 visibility = [ ":*" ]
Primiano Tucci2a29ac72017-10-24 17:47:19 +0100469 include_dirs = [ "benchmark/include" ]
Hector Dearman88a10112017-10-12 11:07:10 +0100470 cflags = [
471 "-Wno-global-constructors",
472 "-Wno-covered-switch-default",
Hector Dearman88a10112017-10-12 11:07:10 +0100473 ]
474}
475
476source_set("benchmark") {
477 testonly = true
478 sources = [
479 "benchmark/include/benchmark/benchmark.h",
480 "benchmark/include/benchmark/benchmark_api.h",
481 "benchmark/include/benchmark/reporter.h",
482 "benchmark/src/arraysize.h",
483 "benchmark/src/benchmark.cc",
484 "benchmark/src/benchmark_api_internal.h",
485 "benchmark/src/benchmark_register.cc",
486 "benchmark/src/check.h",
487 "benchmark/src/colorprint.cc",
488 "benchmark/src/colorprint.h",
489 "benchmark/src/commandlineflags.cc",
490 "benchmark/src/commandlineflags.h",
491 "benchmark/src/complexity.cc",
492 "benchmark/src/complexity.h",
493 "benchmark/src/console_reporter.cc",
494 "benchmark/src/counter.cc",
495 "benchmark/src/counter.h",
496 "benchmark/src/csv_reporter.cc",
497 "benchmark/src/cycleclock.h",
498 "benchmark/src/internal_macros.h",
499 "benchmark/src/json_reporter.cc",
500 "benchmark/src/log.h",
501 "benchmark/src/mutex.h",
502 "benchmark/src/re.h",
503 "benchmark/src/reporter.cc",
504 "benchmark/src/sleep.cc",
505 "benchmark/src/sleep.h",
506 "benchmark/src/stat.h",
507 "benchmark/src/string_util.cc",
508 "benchmark/src/string_util.h",
509 "benchmark/src/sysinfo.cc",
510 "benchmark/src/sysinfo.h",
511 "benchmark/src/timers.cc",
512 "benchmark/src/timers.h",
513 ]
514 defines = [ "HAVE_POSIX_REGEX" ]
515 public_configs = [ ":benchmark_config" ]
516 all_dependent_configs = [ ":benchmark_config" ]
Primiano Tucci2a29ac72017-10-24 17:47:19 +0100517 configs -= [ "//build:extra_warnings" ]
Hector Dearman88a10112017-10-12 11:07:10 +0100518}