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