Instrumenting context getter and predictor to find jank.
[chromium-blink-merge.git] / breakpad / BUILD.gn
blob1598aac958050d20fbfb3caf0eec3856c8ff52a9
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
3 # found in the LICENSE file.
5 config("tools_config") {
6   include_dirs = [
7     "src",
8     "src/third_party",
9   ]
10   if (is_android) {
11     defines = [ "__ANDROID__" ]
12   }
13   if (is_clang) {
14     cflags = [ "-Wno-tautological-constant-out-of-range-compare" ]
15   }
18 config("internal_config") {
19   include_dirs = [ "src" ]
20   defines = []
21   if (is_debug) {
22     # This is needed for GTMLogger to work correctly.
23     defines += [ "DEBUG" ]
24   }
25   if (is_android) {
26     defines += [ "__ANDROID__" ]
27   }
30 config("client_config") {
31   include_dirs = [ "src" ]
32   if (is_android) {
33     include_dirs += [ "src/common/android/include" ]
34   }
37 config("handler_config") {
38   include_dirs = [ "src" ]
41 # {micro,mini}dump_stackwalk and minidump_dump are tool-type executables that do
42 # not build on iOS.
43 if (current_toolchain == host_toolchain && !is_win) {
44   # Contains the code shared by both {micro,mini}dump_stackwalk.
45   static_library("stackwalk_common") {
46     sources = [
47       "src/processor/basic_code_module.h",
48       "src/processor/basic_code_modules.cc",
49       "src/processor/basic_code_modules.h",
50       "src/processor/basic_source_line_resolver.cc",
51       "src/processor/binarystream.cc",
52       "src/processor/binarystream.h",
53       "src/processor/call_stack.cc",
54       "src/processor/cfi_frame_info.cc",
55       "src/processor/cfi_frame_info.h",
56       "src/processor/disassembler_x86.cc",
57       "src/processor/disassembler_x86.h",
58       "src/processor/dump_context.cc",
59       "src/processor/dump_object.cc",
60       "src/processor/logging.cc",
61       "src/processor/logging.h",
62       "src/processor/pathname_stripper.cc",
63       "src/processor/pathname_stripper.h",
64       "src/processor/process_state.cc",
65       "src/processor/simple_symbol_supplier.cc",
66       "src/processor/simple_symbol_supplier.h",
67       "src/processor/source_line_resolver_base.cc",
68       "src/processor/stack_frame_cpu.cc",
69       "src/processor/stack_frame_symbolizer.cc",
70       "src/processor/stackwalk_common.cc",
71       "src/processor/stackwalker.cc",
72       "src/processor/stackwalker_amd64.cc",
73       "src/processor/stackwalker_amd64.h",
74       "src/processor/stackwalker_arm.cc",
75       "src/processor/stackwalker_arm.h",
76       "src/processor/stackwalker_arm64.cc",
77       "src/processor/stackwalker_arm64.h",
78       "src/processor/stackwalker_mips.cc",
79       "src/processor/stackwalker_mips.h",
80       "src/processor/stackwalker_ppc.cc",
81       "src/processor/stackwalker_ppc.h",
82       "src/processor/stackwalker_ppc64.cc",
83       "src/processor/stackwalker_ppc64.h",
84       "src/processor/stackwalker_sparc.cc",
85       "src/processor/stackwalker_sparc.h",
86       "src/processor/stackwalker_x86.cc",
87       "src/processor/stackwalker_x86.h",
88       "src/processor/tokenize.cc",
89       "src/processor/tokenize.h",
91       # libdisasm
92       "src/third_party/libdisasm/ia32_implicit.c",
93       "src/third_party/libdisasm/ia32_implicit.h",
94       "src/third_party/libdisasm/ia32_insn.c",
95       "src/third_party/libdisasm/ia32_insn.h",
96       "src/third_party/libdisasm/ia32_invariant.c",
97       "src/third_party/libdisasm/ia32_invariant.h",
98       "src/third_party/libdisasm/ia32_modrm.c",
99       "src/third_party/libdisasm/ia32_modrm.h",
100       "src/third_party/libdisasm/ia32_opcode_tables.c",
101       "src/third_party/libdisasm/ia32_opcode_tables.h",
102       "src/third_party/libdisasm/ia32_operand.c",
103       "src/third_party/libdisasm/ia32_operand.h",
104       "src/third_party/libdisasm/ia32_reg.c",
105       "src/third_party/libdisasm/ia32_reg.h",
106       "src/third_party/libdisasm/ia32_settings.c",
107       "src/third_party/libdisasm/ia32_settings.h",
108       "src/third_party/libdisasm/libdis.h",
109       "src/third_party/libdisasm/qword.h",
110       "src/third_party/libdisasm/x86_disasm.c",
111       "src/third_party/libdisasm/x86_format.c",
112       "src/third_party/libdisasm/x86_imm.c",
113       "src/third_party/libdisasm/x86_imm.h",
114       "src/third_party/libdisasm/x86_insn.c",
115       "src/third_party/libdisasm/x86_misc.c",
116       "src/third_party/libdisasm/x86_operand_list.c",
117       "src/third_party/libdisasm/x86_operand_list.h",
118     ]
120     defines = [ "BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR" ]
122     configs -= [ "//build/config/compiler:chromium_code" ]
123     configs += [ "//build/config/compiler:no_chromium_code" ]
124     configs += [ ":tools_config" ]
125   }
127   executable("microdump_stackwalk") {
128     sources = [
129       "src/processor/microdump.cc",
130       "src/processor/microdump_processor.cc",
131       "src/processor/microdump_stackwalk.cc",
132     ]
134     deps = [
135       ":stackwalk_common",
136     ]
138     defines = [ "BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR" ]
140     configs -= [ "//build/config/compiler:chromium_code" ]
141     configs += [ "//build/config/compiler:no_chromium_code" ]
142     configs += [ ":tools_config" ]
143   }
145   executable("minidump_stackwalk") {
146     sources = [
147       "src/processor/exploitability.cc",
148       "src/processor/minidump.cc",
149       "src/processor/minidump_processor.cc",
150       "src/processor/minidump_stackwalk.cc",
151     ]
153     deps = [
154       ":stackwalk_common",
155     ]
157     defines = [ "BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR" ]
159     configs -= [ "//build/config/compiler:chromium_code" ]
160     configs += [ "//build/config/compiler:no_chromium_code" ]
161     configs += [ ":tools_config" ]
163     # Always want these files included regardless of platform.
164     set_sources_assignment_filter([])
165     sources += [
166       "src/processor/exploitability_linux.cc",
167       "src/processor/exploitability_linux.h",
168       "src/processor/exploitability_win.cc",
169       "src/processor/exploitability_win.h",
170     ]
171   }
173   executable("minidump_dump") {
174     sources = [
175       "src/processor/basic_code_module.h",
176       "src/processor/basic_code_modules.cc",
177       "src/processor/basic_code_modules.h",
178       "src/processor/dump_context.cc",
179       "src/processor/dump_object.cc",
180       "src/processor/logging.cc",
181       "src/processor/logging.h",
182       "src/processor/minidump.cc",
183       "src/processor/minidump_dump.cc",
184       "src/processor/pathname_stripper.cc",
185       "src/processor/pathname_stripper.h",
186     ]
188     configs += [ ":tools_config" ]
190     # There are some warnings in this code.
191     configs -= [ "//build/config/compiler:chromium_code" ]
192     configs += [ "//build/config/compiler:no_chromium_code" ]
193   }
196 # Mac --------------------------------------------------------------------------
198 if (current_toolchain == host_toolchain && is_mac) {
199   # TODO(GYP) This should be only 64-bit on Mac. From .gypi:
200   # Like ld, dump_syms needs to operate on enough data that it may
201   # actually need to be able to address more than 4GB. Use x86_64.
202   # Don't worry! An x86_64 dump_syms is perfectly able to dump
203   # 32-bit files.
204   executable("dump_syms") {
205     sources = [
206       "src/common/dwarf/bytereader.cc",
207       "src/common/dwarf_cfi_to_module.cc",
208       "src/common/dwarf_cu_to_module.cc",
209       "src/common/dwarf/dwarf2diehandler.cc",
210       "src/common/dwarf/dwarf2reader.cc",
211       "src/common/dwarf_line_to_module.cc",
212       "src/common/language.cc",
213       "src/common/mac/arch_utilities.cc",
214       "src/common/mac/arch_utilities.h",
215       "src/common/mac/dump_syms.mm",
216       "src/common/mac/file_id.cc",
217       "src/common/mac/macho_id.cc",
218       "src/common/mac/macho_reader.cc",
219       "src/common/mac/macho_utilities.cc",
220       "src/common/mac/macho_walker.cc",
221       "src/common/md5.cc",
222       "src/common/module.cc",
223       "src/common/stabs_reader.cc",
224       "src/common/stabs_to_module.cc",
225       "src/tools/mac/dump_syms/dump_syms_tool.mm",
226     ]
228     # For src/common/stabs_reader.h.
229     defines = [ "HAVE_MACH_O_NLIST_H" ]
230     include_dirs = [ "src/common/mac" ]
232     # The DWARF utilities require -funsigned-char.
233     cflags = [ "-funsigned-char" ]
235     configs += [ ":internal_config" ]
237     configs -= [ "//build/config/compiler:chromium_code" ]
238     configs += [ "//build/config/compiler:no_chromium_code" ]
240     # dwarf2reader.cc uses dynamic_cast.
241     configs -= [ "//build/config/compiler:no_rtti" ]
242     configs += [ "//build/config/compiler:rtti" ]
244     libs = [ "Foundation.framework" ]
246     if (!is_debug) {
247       # dump_syms crashes when built at -O1, -O2, and -O3.  It does
248       # not crash at -Os.  To play it safe, dump_syms is always built
249       # at -O0 until this can be sorted out.
250       # http://code.google.com/p/google-breakpad/issues/detail?id=329
251       configs -= [ "//build/config/compiler:optimize" ]
252       cflags += [ "-O0" ]
253     }
254   }
256   executable("symupload") {
257     sources = [
258       "src/common/mac/HTTPMultipartUpload.m",
259       "src/tools/mac/symupload/symupload.m",
260     ]
262     include_dirs = [ "src/common/mac" ]
264     libs = [ "Foundation.framework" ]
266     configs -= [ "//build/config/compiler:chromium_code" ]
267     configs += [ "//build/config/compiler:no_chromium_code" ]
268   }
271 if (is_mac) {
272   static_library("utilities") {
273     sources = [
274       "src/client/mac/crash_generation/ConfigFile.mm",
275       "src/client/mac/handler/breakpad_nlist_64.cc",
276       "src/client/mac/handler/dynamic_images.cc",
277       "src/client/mac/handler/minidump_generator.cc",
278       "src/client/minidump_file_writer.cc",
279       "src/common/convert_UTF.c",
280       "src/common/mac/MachIPC.mm",
281       "src/common/mac/arch_utilities.cc",
282       "src/common/mac/bootstrap_compat.cc",
283       "src/common/mac/file_id.cc",
284       "src/common/mac/launch_reporter.cc",
285       "src/common/mac/macho_id.cc",
286       "src/common/mac/macho_utilities.cc",
287       "src/common/mac/macho_walker.cc",
288       "src/common/mac/string_utilities.cc",
289       "src/common/md5.cc",
290       "src/common/simple_string_dictionary.cc",
291       "src/common/string_conversion.cc",
292     ]
294     configs += [ ":internal_config" ]
296     # There are some warnings in this code.
297     configs -= [ "//build/config/compiler:chromium_code" ]
298     configs += [ "//build/config/compiler:no_chromium_code" ]
299   }
301   executable("crash_inspector") {
302     sources = [
303       "src/client/mac/crash_generation/Inspector.mm",
304       "src/client/mac/crash_generation/InspectorMain.mm",
305     ]
307     # TODO(GYP): 'mac_real_dsym': 1,
309     include_dirs = [
310       "src/client/apple/Framework",
311       "src/common/mac",
312       "src",
313     ]
314     libs = [
315       "CoreServices.framework",
316       "Foundation.framework",
317     ]
319     deps = [
320       ":utilities",
321     ]
322   }
324   # TODO(GYP) this target has some mac_bundle_resources stuff.
325   # executable("crash_report_sender") {
326   # }
327   group("crash_report_sender") {
328   }
330   config("breakpad_config") {
331     include_dirs = [ "src/client/apple/Framework" ]
332   }
334   static_library("breakpad") {
335     sources = [
336       "src/client/mac/crash_generation/crash_generation_client.cc",
337       "src/client/mac/crash_generation/crash_generation_client.h",
338       "src/client/mac/handler/protected_memory_allocator.cc",
339       "src/client/mac/handler/exception_handler.cc",
340       "src/client/mac/Framework/Breakpad.mm",
341       "src/client/mac/Framework/OnDemandServer.mm",
342     ]
344     configs += [ ":internal_config" ]
345     public_configs = [ ":breakpad_config" ]
347     defines = [ "USE_PROTECTED_ALLOCATIONS=1" ]
348     include_dirs = [ "src/client/apple/Framework" ]
350     deps = [
351       ":utilities",
352       ":crash_inspector",
353       ":crash_report_sender",
354     ]
355   }
357   group("client") {
358     public_configs = [ ":client_config" ]
359   }
362 if (is_linux) {
363   executable("symupload") {
364     sources = [
365       "src/tools/linux/symupload/sym_upload.cc",
366       "src/common/linux/http_upload.cc",
367       "src/common/linux/http_upload.h",
368     ]
370     include_dirs = [
371       "src",
372       "src/third_party",
373     ]
375     configs += [ ":tools_config" ]
377     libs = [ "dl" ]
378   }
381 if (is_linux || is_android) {
382   if (current_toolchain == host_toolchain) {
383     # dump_syms is a host tool, so only compile it for the host system.
384     executable("dump_syms") {
385       sources = [
386         "src/common/dwarf/bytereader.cc",
387         "src/common/dwarf_cfi_to_module.cc",
388         "src/common/dwarf_cfi_to_module.h",
389         "src/common/dwarf_cu_to_module.cc",
390         "src/common/dwarf_cu_to_module.h",
391         "src/common/dwarf/dwarf2diehandler.cc",
392         "src/common/dwarf/dwarf2reader.cc",
393         "src/common/dwarf_line_to_module.cc",
394         "src/common/dwarf_line_to_module.h",
395         "src/common/language.cc",
396         "src/common/language.h",
397         "src/common/linux/crc32.cc",
398         "src/common/linux/crc32.h",
399         "src/common/linux/dump_symbols.cc",
400         "src/common/linux/dump_symbols.h",
401         "src/common/linux/elf_symbols_to_module.cc",
402         "src/common/linux/elf_symbols_to_module.h",
403         "src/common/linux/elfutils.cc",
404         "src/common/linux/elfutils.h",
405         "src/common/linux/file_id.cc",
406         "src/common/linux/file_id.h",
407         "src/common/linux/linux_libc_support.cc",
408         "src/common/linux/linux_libc_support.h",
409         "src/common/linux/memory_mapped_file.cc",
410         "src/common/linux/memory_mapped_file.h",
411         "src/common/linux/guid_creator.h",
412         "src/common/module.cc",
413         "src/common/module.h",
414         "src/common/stabs_reader.cc",
415         "src/common/stabs_reader.h",
416         "src/common/stabs_to_module.cc",
417         "src/common/stabs_to_module.h",
418         "src/tools/linux/dump_syms/dump_syms.cc",
419       ]
421       # There are some warnings in this code.
422       configs -= [ "//build/config/compiler:chromium_code" ]
423       configs += [ "//build/config/compiler:no_chromium_code" ]
425       # dwarf2reader.cc uses dynamic_cast. Because we don't typically
426       # don't support RTTI, we enable it for this single target. Since
427       # dump_syms doesn't share any object files with anything else,
428       # this doesn't end up polluting Chrome itself.
429       configs -= [ "//build/config/compiler:no_rtti" ]
430       configs += [ "//build/config/compiler:rtti" ]
432       # Breakpad rev 583 introduced this flag.
433       # Using this define, stabs_reader.h will include a.out.h to
434       # build on Linux.
435       defines = [ "HAVE_A_OUT_H" ]
437       include_dirs = [ "src" ]
438     }
439   }
441   static_library("client") {
442     # Want all these sources for both Linux and Android.
443     set_sources_assignment_filter([])
444     sources = [
445       "src/client/linux/crash_generation/crash_generation_client.cc",
446       "src/client/linux/crash_generation/crash_generation_client.h",
447       "src/client/linux/dump_writer_common/mapping_info.h",
448       "src/client/linux/dump_writer_common/seccomp_unwinder.cc",
449       "src/client/linux/dump_writer_common/seccomp_unwinder.h",
450       "src/client/linux/dump_writer_common/thread_info.cc",
451       "src/client/linux/dump_writer_common/thread_info.h",
452       "src/client/linux/dump_writer_common/ucontext_reader.cc",
453       "src/client/linux/dump_writer_common/ucontext_reader.h",
454       "src/client/linux/handler/exception_handler.cc",
455       "src/client/linux/handler/exception_handler.h",
456       "src/client/linux/handler/minidump_descriptor.cc",
457       "src/client/linux/handler/minidump_descriptor.h",
458       "src/client/linux/log/log.cc",
459       "src/client/linux/log/log.h",
460       "src/client/linux/microdump_writer/microdump_writer.cc",
461       "src/client/linux/microdump_writer/microdump_writer.h",
462       "src/client/linux/minidump_writer/cpu_set.h",
463       "src/client/linux/minidump_writer/directory_reader.h",
464       "src/client/linux/minidump_writer/line_reader.h",
465       "src/client/linux/minidump_writer/linux_core_dumper.cc",
466       "src/client/linux/minidump_writer/linux_core_dumper.h",
467       "src/client/linux/minidump_writer/linux_dumper.cc",
468       "src/client/linux/minidump_writer/linux_dumper.h",
469       "src/client/linux/minidump_writer/linux_ptrace_dumper.cc",
470       "src/client/linux/minidump_writer/linux_ptrace_dumper.h",
471       "src/client/linux/minidump_writer/minidump_writer.cc",
472       "src/client/linux/minidump_writer/minidump_writer.h",
473       "src/client/linux/minidump_writer/proc_cpuinfo_reader.h",
474       "src/client/minidump_file_writer-inl.h",
475       "src/client/minidump_file_writer.cc",
476       "src/client/minidump_file_writer.h",
477       "src/common/convert_UTF.c",
478       "src/common/convert_UTF.h",
479       "src/common/linux/elf_core_dump.cc",
480       "src/common/linux/elf_core_dump.h",
481       "src/common/linux/elfutils.cc",
482       "src/common/linux/elfutils.h",
483       "src/common/linux/file_id.cc",
484       "src/common/linux/file_id.h",
485       "src/common/linux/google_crashdump_uploader.cc",
486       "src/common/linux/google_crashdump_uploader.h",
487       "src/common/linux/guid_creator.cc",
488       "src/common/linux/guid_creator.h",
489       "src/common/linux/libcurl_wrapper.cc",
490       "src/common/linux/libcurl_wrapper.h",
491       "src/common/linux/linux_libc_support.cc",
492       "src/common/linux/linux_libc_support.h",
493       "src/common/linux/memory_mapped_file.cc",
494       "src/common/linux/memory_mapped_file.h",
495       "src/common/linux/safe_readlink.cc",
496       "src/common/linux/safe_readlink.h",
497       "src/common/memory.h",
498       "src/common/simple_string_dictionary.cc",
499       "src/common/simple_string_dictionary.h",
500       "src/common/string_conversion.cc",
501       "src/common/string_conversion.h",
502     ]
504     configs -= [ "//build/config/compiler:chromium_code" ]
505     configs += [ "//build/config/compiler:no_chromium_code" ]
506     public_configs = [ ":client_config" ]
508     if (cpu_arch == "arm" && is_chromeos) {
509       # Avoid running out of registers in
510       # linux_syscall_support.h:sys_clone()'s inline assembly.
511       cflags = [ "-marm" ]
512     }
514     if (is_android) {
515       sources += [ "src/common/android/breakpad_getcontext.S" ]
516     }
518     libs = [ "dl" ]
520     include_dirs = [
521       ".",
522       "src",
523       "src/client",
524       "src/third_party/linux/include",
525     ]
526   }
528   static_library("processor_support") {
529     sources = [
530       "src/common/scoped_ptr.h",
531       "src/processor/basic_code_modules.cc",
532       "src/processor/basic_code_modules.h",
533       "src/processor/dump_context.cc",
534       "src/processor/dump_object.cc",
535       "src/processor/logging.cc",
536       "src/processor/logging.h",
537       "src/processor/minidump.cc",
538       "src/processor/pathname_stripper.cc",
539       "src/processor/pathname_stripper.h",
540     ]
542     include_dirs = [
543       "src",
544       "src/client",
545       "src/third_party/linux/include",
546       ".",
547     ]
549     # There are some warnings in this code.
550     configs -= [ "//build/config/compiler:chromium_code" ]
551     configs += [ "//build/config/compiler:no_chromium_code" ]
552   }
555 if (is_linux) {
556   test("breakpad_unittests") {
557     sources = [
558       "linux/breakpad_googletest_includes.h",
559       "src/client/linux/handler/exception_handler_unittest.cc",
560       "src/client/linux/minidump_writer/cpu_set_unittest.cc",
561       "src/client/linux/minidump_writer/directory_reader_unittest.cc",
562       "src/client/linux/minidump_writer/line_reader_unittest.cc",
563       "src/client/linux/minidump_writer/linux_core_dumper_unittest.cc",
564       "src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc",
565       "src/client/linux/minidump_writer/minidump_writer_unittest.cc",
566       "src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc",
567       "src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc",
568       "src/common/linux/elf_core_dump_unittest.cc",
569       "src/common/linux/file_id_unittest.cc",
570       "src/common/linux/linux_libc_support_unittest.cc",
571       "src/common/linux/synth_elf.cc",
572       "src/common/linux/tests/auto_testfile.h",
573       "src/common/linux/tests/crash_generator.cc",
574       "src/common/linux/tests/crash_generator.h",
575       "src/common/memory_range.h",
576       "src/common/memory_unittest.cc",
577       "src/common/simple_string_dictionary_unittest.cc",
578       "src/common/test_assembler.cc",
579       "src/common/tests/file_utils.cc",
580       "src/common/tests/file_utils.h",
581       "src/tools/linux/md2core/minidump_memory_range.h",
582       "src/tools/linux/md2core/minidump_memory_range_unittest.cc",
583     ]
585     deps = [
586       ":client",
587       ":processor_support",
588       ":linux_dumper_unittest_helper",
589       "//testing/gtest",
590       "//testing/gtest:gtest_main",
591       "//testing/gmock",
592     ]
594     include_dirs = [
595       "linux",  # Use our copy of breakpad_googletest_includes.h
596       "src",
597       ".",
598     ]
600     # There are some warnings in this code.
601     configs -= [ "//build/config/compiler:chromium_code" ]
602     configs += [ "//build/config/compiler:no_chromium_code" ]
604     if (is_clang) {
605       # See http://crbug.com/138571#c18
606       cflags = [ "-Wno-unused-value" ]
607     }
609     if (is_android) {
610       sources += [ "src/common/android/breakpad_getcontext_unittest.cc" ]
611       libs = [ "log" ]
612       include_dirs += [ "src/common/android/include" ]
613     }
614   }
616   executable("linux_dumper_unittest_helper") {
617     testonly = true
618     sources = [
619       "src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc",
620     ]
621     deps = [
622       ":processor_support",
623     ]
625     include_dirs = [ "src" ]
627     if (cpu_arch == "mipsel" && is_android) {
628       include_dirs += [ "src/common/android/include" ]
629     }
630   }
632   executable("generate_test_dump") {
633     testonly = true
634     sources = [
635       "linux/generate-test-dump.cc",
636     ]
638     # This file has an unused variable warning.
639     configs -= [ "//build/config/compiler:chromium_code" ]
640     configs += [ "//build/config/compiler:no_chromium_code" ]
642     deps = [
643       ":client",
644     ]
646     include_dirs = [ "src" ]
648     if (is_android) {
649       libs = [ "log" ]
650       include_dirs += [ "src/common/android/include" ]
651     }
652   }
654   executable("minidump-2-core") {
655     sources = [
656       "src/tools/linux/md2core/minidump-2-core.cc",
657     ]
659     include_dirs = [ "src" ]
661     deps = [
662       ":client",
663     ]
664   }
666   executable("core-2-minidump") {
667     sources = [
668       "src/tools/linux/core2md/core2md.cc",
669     ]
671     deps = [
672       ":client",
673     ]
675     include_dirs = [ "src" ]
676   }
679 if (is_ios) {
680   static_library("client") {
681     sources = [
682       "src/client/ios/Breakpad.h",
683       "src/client/ios/Breakpad.mm",
684       "src/client/ios/BreakpadController.h",
685       "src/client/ios/BreakpadController.mm",
686       "src/client/ios/handler/ios_exception_minidump_generator.mm",
687       "src/client/ios/handler/ios_exception_minidump_generator.h",
688       "src/client/mac/crash_generation/ConfigFile.h",
689       "src/client/mac/crash_generation/ConfigFile.mm",
690       "src/client/mac/handler/breakpad_nlist_64.cc",
691       "src/client/mac/handler/breakpad_nlist_64.h",
692       "src/client/mac/handler/dynamic_images.cc",
693       "src/client/mac/handler/dynamic_images.h",
694       "src/client/mac/handler/protected_memory_allocator.cc",
695       "src/client/mac/handler/protected_memory_allocator.h",
696       "src/client/mac/handler/exception_handler.cc",
697       "src/client/mac/handler/exception_handler.h",
698       "src/client/mac/handler/minidump_generator.cc",
699       "src/client/mac/handler/minidump_generator.h",
700       "src/client/mac/sender/uploader.h",
701       "src/client/mac/sender/uploader.mm",
702       "src/client/minidump_file_writer.cc",
703       "src/client/minidump_file_writer.h",
704       "src/client/minidump_file_writer-inl.h",
705       "src/common/convert_UTF.c",
706       "src/common/convert_UTF.h",
707       "src/common/mac/file_id.cc",
708       "src/common/mac/file_id.h",
709       "src/common/mac/HTTPMultipartUpload.m",
710       "src/common/mac/macho_id.cc",
711       "src/common/mac/macho_id.h",
712       "src/common/mac/macho_utilities.cc",
713       "src/common/mac/macho_utilities.h",
714       "src/common/mac/macho_walker.cc",
715       "src/common/mac/macho_walker.h",
716       "src/common/mac/string_utilities.cc",
717       "src/common/mac/string_utilities.h",
718       "src/common/md5.cc",
719       "src/common/md5.h",
720       "src/common/simple_string_dictionary.cc",
721       "src/common/simple_string_dictionary.h",
722       "src/common/string_conversion.cc",
723       "src/common/string_conversion.h",
724       "src/google_breakpad/common/minidump_format.h",
725     ]
727     include_dirs = [
728       "src",
729       "src/client/mac/Framework",
730       "src/common/mac",
731     ]
732   }
733   # TODO(GYP) There is some XCode-only targets like ninja-breakpad.
736 if (is_win) {
737   group("client") {
738     public_configs = [ ":client_config" ]
739   }
741   source_set("breakpad_handler") {
742     configs += [ ":handler_config" ]
743     if (is_win) {
744       public_configs = [ ":handler_config" ]
745     }
747     defines = [ "BREAKPAD_NO_TERMINATE_THREAD" ]
749     sources = [
750       "src/client/windows/crash_generation/client_info.cc",
751       "src/client/windows/crash_generation/client_info.h",
752       "src/client/windows/crash_generation/crash_generation_client.cc",
753       "src/client/windows/crash_generation/crash_generation_client.h",
754       "src/client/windows/crash_generation/crash_generation_server.cc",
755       "src/client/windows/crash_generation/crash_generation_server.h",
756       "src/client/windows/handler/exception_handler.cc",
757       "src/client/windows/handler/exception_handler.h",
758       "src/common/windows/guid_string.cc",
759       "src/common/windows/guid_string.h",
760       "src/google_breakpad/common/minidump_format.h",
761       "src/client/windows/crash_generation/minidump_generator.cc",
762       "src/client/windows/crash_generation/minidump_generator.h",
763       "src/common/windows/string_utils-inl.h",
764     ]
765   }