Adding a timeout between resource manager operations to avoid too aggressive release...
[chromium-blink-merge.git] / breakpad / breakpad.gyp
blobc70bdd33e8cc8db0e2aa1a9147353fa51df4386f
1 # Copyright (c) 2012 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.
6   'includes': [
7     'breakpad_sender.gypi',
8     'breakpad_handler.gypi',
9   ],
10   'conditions': [
11     # minidump_stackwalk and minidump_dump are tool-type executables that do
12     # not build on iOS.
13     ['OS!="ios" and OS!="win"', {
14       'targets': [
15         {
16           # GN version: //breakpad:minidump_stackwalk
17           'target_name': 'minidump_stackwalk',
18           'type': 'executable',
19           'includes': ['breakpad_tools.gypi'],
20           'defines': ['BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR'],
21           'sources': [
22             'src/processor/basic_code_module.h',
23             'src/processor/basic_code_modules.cc',
24             'src/processor/basic_code_modules.h',
25             'src/processor/basic_source_line_resolver.cc',
26             'src/processor/binarystream.cc',
27             'src/processor/binarystream.h',
28             'src/processor/call_stack.cc',
29             'src/processor/cfi_frame_info.cc',
30             'src/processor/cfi_frame_info.h',
31             'src/processor/disassembler_x86.cc',
32             'src/processor/disassembler_x86.h',
33             'src/processor/dump_context.cc',
34             'src/processor/dump_object.cc',
35             'src/processor/exploitability.cc',
36             'src/processor/exploitability_linux.cc',
37             'src/processor/exploitability_linux.h',
38             'src/processor/exploitability_win.cc',
39             'src/processor/exploitability_win.h',
40             'src/processor/logging.cc',
41             'src/processor/logging.h',
42             'src/processor/minidump.cc',
43             'src/processor/minidump_processor.cc',
44             'src/processor/minidump_stackwalk.cc',
45             'src/processor/pathname_stripper.cc',
46             'src/processor/pathname_stripper.h',
47             'src/processor/process_state.cc',
48             'src/processor/simple_symbol_supplier.cc',
49             'src/processor/simple_symbol_supplier.h',
50             'src/processor/source_line_resolver_base.cc',
51             'src/processor/stack_frame_cpu.cc',
52             'src/processor/stack_frame_symbolizer.cc',
53             'src/processor/stackwalker.cc',
54             'src/processor/stackwalker_amd64.cc',
55             'src/processor/stackwalker_amd64.h',
56             'src/processor/stackwalker_arm.cc',
57             'src/processor/stackwalker_arm.h',
58             'src/processor/stackwalker_arm64.cc',
59             'src/processor/stackwalker_arm64.h',
60             'src/processor/stackwalker_mips.cc',
61             'src/processor/stackwalker_mips.h',
62             'src/processor/stackwalker_ppc.cc',
63             'src/processor/stackwalker_ppc.h',
64             'src/processor/stackwalker_ppc64.cc',
65             'src/processor/stackwalker_ppc64.h',
66             'src/processor/stackwalker_sparc.cc',
67             'src/processor/stackwalker_sparc.h',
68             'src/processor/stackwalker_x86.cc',
69             'src/processor/stackwalker_x86.h',
70             'src/processor/tokenize.cc',
71             'src/processor/tokenize.h',
72             # libdisasm
73             'src/third_party/libdisasm/ia32_implicit.c',
74             'src/third_party/libdisasm/ia32_implicit.h',
75             'src/third_party/libdisasm/ia32_insn.c',
76             'src/third_party/libdisasm/ia32_insn.h',
77             'src/third_party/libdisasm/ia32_invariant.c',
78             'src/third_party/libdisasm/ia32_invariant.h',
79             'src/third_party/libdisasm/ia32_modrm.c',
80             'src/third_party/libdisasm/ia32_modrm.h',
81             'src/third_party/libdisasm/ia32_opcode_tables.c',
82             'src/third_party/libdisasm/ia32_opcode_tables.h',
83             'src/third_party/libdisasm/ia32_operand.c',
84             'src/third_party/libdisasm/ia32_operand.h',
85             'src/third_party/libdisasm/ia32_reg.c',
86             'src/third_party/libdisasm/ia32_reg.h',
87             'src/third_party/libdisasm/ia32_settings.c',
88             'src/third_party/libdisasm/ia32_settings.h',
89             'src/third_party/libdisasm/libdis.h',
90             'src/third_party/libdisasm/qword.h',
91             'src/third_party/libdisasm/x86_disasm.c',
92             'src/third_party/libdisasm/x86_format.c',
93             'src/third_party/libdisasm/x86_imm.c',
94             'src/third_party/libdisasm/x86_imm.h',
95             'src/third_party/libdisasm/x86_insn.c',
96             'src/third_party/libdisasm/x86_misc.c',
97             'src/third_party/libdisasm/x86_operand_list.c',
98             'src/third_party/libdisasm/x86_operand_list.h',
99           ],
100         },
101         {
102           # GN version: //breakpad:minidump_dump
103           'target_name': 'minidump_dump',
104           'type': 'executable',
105           'includes': ['breakpad_tools.gypi'],
106           'sources': [
107             'src/processor/basic_code_module.h',
108             'src/processor/basic_code_modules.cc',
109             'src/processor/basic_code_modules.h',
110             'src/processor/dump_context.cc',
111             'src/processor/dump_object.cc',
112             'src/processor/logging.cc',
113             'src/processor/logging.h',
114             'src/processor/minidump.cc',
115             'src/processor/minidump_dump.cc',
116             'src/processor/pathname_stripper.cc',
117             'src/processor/pathname_stripper.h',
118           ],
119         },
120       ],
121     }],
122     ['OS=="mac" or (OS=="ios" and "<(GENERATOR)"=="ninja")', {
123       'target_defaults': {
124         'include_dirs': [
125           'src',
126         ],
127         'configurations': {
128           'Debug_Base': {
129             'defines': [
130               # This is needed for GTMLogger to work correctly.
131               'DEBUG',
132             ],
133           },
134         },
135       },
136       'targets': [
137         {
138           # GN version: //breakpad:dump_syms
139           'target_name': 'dump_syms',
140           'type': 'executable',
141           'toolsets': ['host'],
142           'include_dirs': [
143             'src/common/mac',
144           ],
145           'sources': [
146             'src/common/dwarf/bytereader.cc',
147             'src/common/dwarf_cfi_to_module.cc',
148             'src/common/dwarf_cu_to_module.cc',
149             'src/common/dwarf/dwarf2diehandler.cc',
150             'src/common/dwarf/dwarf2reader.cc',
151             'src/common/dwarf_line_to_module.cc',
152             'src/common/language.cc',
153             'src/common/mac/arch_utilities.cc',
154             'src/common/mac/arch_utilities.h',
155             'src/common/mac/dump_syms.mm',
156             'src/common/mac/file_id.cc',
157             'src/common/mac/macho_id.cc',
158             'src/common/mac/macho_reader.cc',
159             'src/common/mac/macho_utilities.cc',
160             'src/common/mac/macho_walker.cc',
161             'src/common/md5.cc',
162             'src/common/module.cc',
163             'src/common/stabs_reader.cc',
164             'src/common/stabs_to_module.cc',
165             'src/tools/mac/dump_syms/dump_syms_tool.mm',
166           ],
167           'defines': [
168             # For src/common/stabs_reader.h.
169             'HAVE_MACH_O_NLIST_H',
170           ],
171           'xcode_settings': {
172             # Like ld, dump_syms needs to operate on enough data that it may
173             # actually need to be able to address more than 4GB. Use x86_64.
174             # Don't worry! An x86_64 dump_syms is perfectly able to dump
175             # 32-bit files.
176             'ARCHS': [
177               'x86_64',
178             ],
180             # The DWARF utilities require -funsigned-char.
181             'GCC_CHAR_IS_UNSIGNED_CHAR': 'YES',
183             # dwarf2reader.cc uses dynamic_cast.
184             'GCC_ENABLE_CPP_RTTI': 'YES',
185           },
186           'link_settings': {
187             'libraries': [
188               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
189             ],
190           },
191           'configurations': {
192             'Release_Base': {
193               'xcode_settings': {
194                 # dump_syms crashes when built at -O1, -O2, and -O3.  It does
195                 # not crash at -Os.  To play it safe, dump_syms is always built
196                 # at -O0 until this can be sorted out.
197                 # http://code.google.com/p/google-breakpad/issues/detail?id=329
198                 'GCC_OPTIMIZATION_LEVEL': '0',  # -O0
199                },
200              },
201           },
202         },
203         {
204           # GN version: //breakpad:symupload
205           'target_name': 'symupload',
206           'type': 'executable',
207           'toolsets': ['host'],
208           'include_dirs': [
209             'src/common/mac',
210           ],
211           'sources': [
212             'src/common/mac/HTTPMultipartUpload.m',
213             'src/tools/mac/symupload/symupload.m',
214           ],
215           'link_settings': {
216             'libraries': [
217               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
218             ],
219           }
220         },
221       ],
222     }],
223     ['OS=="mac"', {
224       'target_defaults': {
225         'include_dirs': [
226           'src',
227         ],
228         'configurations': {
229           'Debug_Base': {
230             'defines': [
231               # This is needed for GTMLogger to work correctly.
232               'DEBUG',
233             ],
234           },
235         },
236       },
237       'targets': [
238         {
239           # GN version: //breakpad:utilities
240           'target_name': 'breakpad_utilities',
241           'type': 'static_library',
242           'sources': [
243             'src/client/mac/crash_generation/ConfigFile.mm',
244             'src/client/mac/handler/breakpad_nlist_64.cc',
245             'src/client/mac/handler/dynamic_images.cc',
246             'src/client/mac/handler/minidump_generator.cc',
247             'src/client/minidump_file_writer.cc',
248             'src/common/convert_UTF.c',
249             'src/common/mac/MachIPC.mm',
250             'src/common/mac/arch_utilities.cc',
251             'src/common/mac/bootstrap_compat.cc',
252             'src/common/mac/file_id.cc',
253             'src/common/mac/launch_reporter.cc',
254             'src/common/mac/macho_id.cc',
255             'src/common/mac/macho_utilities.cc',
256             'src/common/mac/macho_walker.cc',
257             'src/common/mac/string_utilities.cc',
258             'src/common/md5.cc',
259             'src/common/simple_string_dictionary.cc',
260             'src/common/string_conversion.cc',
261           ],
262         },
263         {
264           # GN version: //breakpad:crash_inspector
265           'target_name': 'crash_inspector',
266           'type': 'executable',
267           'variables': {
268             'mac_real_dsym': 1,
269           },
270           'dependencies': [
271             'breakpad_utilities',
272           ],
273           'include_dirs': [
274             'src/client/apple/Framework',
275             'src/common/mac',
276           ],
277           'sources': [
278             'src/client/mac/crash_generation/Inspector.mm',
279             'src/client/mac/crash_generation/InspectorMain.mm',
280           ],
281           'link_settings': {
282             'libraries': [
283               '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
284               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
285             ],
286           }
287         },
288         {
289           # GN version: //breakpad:crash_report_sender
290           'target_name': 'crash_report_sender',
291           'type': 'executable',
292           'mac_bundle': 1,
293           'variables': {
294             'mac_real_dsym': 1,
295           },
296           'include_dirs': [
297             'src/common/mac',
298           ],
299           'sources': [
300             'src/common/mac/HTTPMultipartUpload.m',
301             'src/client/mac/sender/crash_report_sender.m',
302             'src/client/mac/sender/uploader.mm',
303             'src/common/mac/GTMLogger.m',
304           ],
305           'mac_bundle_resources': [
306             'src/client/mac/sender/English.lproj/Localizable.strings',
307             'src/client/mac/sender/crash_report_sender.icns',
308             'src/client/mac/sender/Breakpad.xib',
309             'src/client/mac/sender/crash_report_sender-Info.plist',
310           ],
311           'mac_bundle_resources!': [
312              'src/client/mac/sender/crash_report_sender-Info.plist',
313           ],
314           'xcode_settings': {
315              'INFOPLIST_FILE': 'src/client/mac/sender/crash_report_sender-Info.plist',
316           },
317           'link_settings': {
318             'libraries': [
319               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
320               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
321               '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
322             ],
323           }
324         },
325         {
326           # GN version: //breakpad
327           'target_name': 'breakpad',
328           'type': 'static_library',
329           'dependencies': [
330             'breakpad_utilities',
331             'crash_inspector',
332             'crash_report_sender',
333           ],
334           'include_dirs': [
335             'src/client/apple/Framework',
336           ],
337           'direct_dependent_settings': {
338             'include_dirs': [
339               'src/client/apple/Framework',
340             ],
341           },
342           'defines': [
343             'USE_PROTECTED_ALLOCATIONS=1',
344           ],
345           'sources': [
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/protected_memory_allocator.cc',
349             'src/client/mac/handler/exception_handler.cc',
350             'src/client/mac/Framework/Breakpad.mm',
351             'src/client/mac/Framework/OnDemandServer.mm',
352           ],
353         },
354       ],
355     }],
356     [ 'OS=="linux" or OS=="android" or OS=="freebsd"', {
357       'conditions': [
358         ['OS=="android"', {
359           'defines': [
360             '__ANDROID__',
361           ],
362         }],
363       ],
364       # Tools needed for archiving build symbols.
365       'targets': [
366         {
367           # GN version: //breakpad:symupload
368           'target_name': 'symupload',
369           'type': 'executable',
371           'includes': ['breakpad_tools.gypi'],
373           'sources': [
374             'src/tools/linux/symupload/sym_upload.cc',
375             'src/common/linux/http_upload.cc',
376             'src/common/linux/http_upload.h',
377           ],
378           'include_dirs': [
379             'src',
380             'src/third_party',
381           ],
382           'link_settings': {
383             'libraries': [
384               '-ldl',
385             ],
386           },
387         },
388         {
389           # GN version: //breakpad:dump_syms
390           'target_name': 'dump_syms',
391           'type': 'executable',
392           'conditions': [
393             ['OS=="android"', {
394               'toolsets': [ 'host' ],
395             }],
396           ],
398           # dwarf2reader.cc uses dynamic_cast. Because we don't typically
399           # don't support RTTI, we enable it for this single target. Since
400           # dump_syms doesn't share any object files with anything else,
401           # this doesn't end up polluting Chrome itself.
402           'cflags_cc!': ['-fno-rtti'],
404           'sources': [
405             'src/common/dwarf/bytereader.cc',
406             'src/common/dwarf_cfi_to_module.cc',
407             'src/common/dwarf_cfi_to_module.h',
408             'src/common/dwarf_cu_to_module.cc',
409             'src/common/dwarf_cu_to_module.h',
410             'src/common/dwarf/dwarf2diehandler.cc',
411             'src/common/dwarf/dwarf2reader.cc',
412             'src/common/dwarf_line_to_module.cc',
413             'src/common/dwarf_line_to_module.h',
414             'src/common/language.cc',
415             'src/common/language.h',
416             'src/common/linux/crc32.cc',
417             'src/common/linux/crc32.h',
418             'src/common/linux/dump_symbols.cc',
419             'src/common/linux/dump_symbols.h',
420             'src/common/linux/elf_symbols_to_module.cc',
421             'src/common/linux/elf_symbols_to_module.h',
422             'src/common/linux/elfutils.cc',
423             'src/common/linux/elfutils.h',
424             'src/common/linux/file_id.cc',
425             'src/common/linux/file_id.h',
426             'src/common/linux/linux_libc_support.cc',
427             'src/common/linux/linux_libc_support.h',
428             'src/common/linux/memory_mapped_file.cc',
429             'src/common/linux/memory_mapped_file.h',
430             'src/common/linux/guid_creator.h',
431             'src/common/module.cc',
432             'src/common/module.h',
433             'src/common/stabs_reader.cc',
434             'src/common/stabs_reader.h',
435             'src/common/stabs_to_module.cc',
436             'src/common/stabs_to_module.h',
437             'src/tools/linux/dump_syms/dump_syms.cc',
438           ],
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': [
444             'HAVE_A_OUT_H',
445           ],
447           'include_dirs': [
448             'src',
449             '..',
450           ],
451         },
452         {
453           # GN version: //breakpad:client
454           'target_name': 'breakpad_client',
455           'type': 'static_library',
457           'sources': [
458             'src/client/linux/crash_generation/crash_generation_client.cc',
459             'src/client/linux/crash_generation/crash_generation_client.h',
460             'src/client/linux/handler/exception_handler.cc',
461             'src/client/linux/handler/exception_handler.h',
462             'src/client/linux/handler/minidump_descriptor.cc',
463             'src/client/linux/handler/minidump_descriptor.h',
464             'src/client/linux/log/log.cc',
465             'src/client/linux/log/log.h',
466             'src/client/linux/minidump_writer/cpu_set.h',
467             'src/client/linux/minidump_writer/directory_reader.h',
468             'src/client/linux/minidump_writer/line_reader.h',
469             'src/client/linux/minidump_writer/linux_core_dumper.cc',
470             'src/client/linux/minidump_writer/linux_core_dumper.h',
471             'src/client/linux/minidump_writer/linux_dumper.cc',
472             'src/client/linux/minidump_writer/linux_dumper.h',
473             'src/client/linux/minidump_writer/linux_ptrace_dumper.cc',
474             'src/client/linux/minidump_writer/linux_ptrace_dumper.h',
475             'src/client/linux/minidump_writer/minidump_writer.cc',
476             'src/client/linux/minidump_writer/minidump_writer.h',
477             'src/client/linux/minidump_writer/proc_cpuinfo_reader.h',
478             'src/client/minidump_file_writer-inl.h',
479             'src/client/minidump_file_writer.cc',
480             'src/client/minidump_file_writer.h',
481             'src/common/convert_UTF.c',
482             'src/common/convert_UTF.h',
483             'src/common/linux/elf_core_dump.cc',
484             'src/common/linux/elf_core_dump.h',
485             'src/common/linux/elfutils.cc',
486             'src/common/linux/elfutils.h',
487             'src/common/linux/file_id.cc',
488             'src/common/linux/file_id.h',
489             'src/common/linux/google_crashdump_uploader.cc',
490             'src/common/linux/google_crashdump_uploader.h',
491             'src/common/linux/guid_creator.cc',
492             'src/common/linux/guid_creator.h',
493             'src/common/linux/libcurl_wrapper.cc',
494             'src/common/linux/libcurl_wrapper.h',
495             'src/common/linux/linux_libc_support.cc',
496             'src/common/linux/linux_libc_support.h',
497             'src/common/linux/memory_mapped_file.cc',
498             'src/common/linux/memory_mapped_file.h',
499             'src/common/linux/safe_readlink.cc',
500             'src/common/linux/safe_readlink.h',
501             'src/common/memory.h',
502             'src/common/simple_string_dictionary.cc',
503             'src/common/simple_string_dictionary.h',
504             'src/common/string_conversion.cc',
505             'src/common/string_conversion.h',
506           ],
508           'conditions': [
509             ['target_arch=="arm" and chromeos==1', {
510               # Avoid running out of registers in
511               # linux_syscall_support.h:sys_clone()'s inline assembly.
512               'cflags': ['-marm'],
513             }],
514             ['OS=="android"', {
515               'include_dirs': [
516                 'src/common/android/include',
517               ],
518               'direct_dependent_settings': {
519                 'include_dirs': [
520                   'src/common/android/include',
521                 ],
522               },
523               'sources': [
524                 'src/common/android/breakpad_getcontext.S',
525               ],
526             }],
527             ['OS!="android"', {
528               'link_settings': {
529                 'libraries': [
530                   # In case of Android, '-ldl' is added in common.gypi, since it
531                   # is needed for stlport_static. For LD, the order of libraries
532                   # is important, and thus we skip to add it here.
533                   '-ldl',
534                 ],
535               },
536             }],
537           ],
539           'include_dirs': [
540             'src',
541             'src/client',
542             'src/third_party/linux/include',
543             '..',
544             '.',
545           ],
546         },
547         {
548           # Breakpad r693 uses some files from src/processor in unit tests.
549           # GN version: //breakpad:processor_support
550           'target_name': 'breakpad_processor_support',
551           'type': 'static_library',
553           'sources': [
554             'src/common/scoped_ptr.h',
555             'src/processor/basic_code_modules.cc',
556             'src/processor/basic_code_modules.h',
557             'src/processor/dump_context.cc',
558             'src/processor/dump_object.cc',
559             'src/processor/logging.cc',
560             'src/processor/logging.h',
561             'src/processor/minidump.cc',
562             'src/processor/pathname_stripper.cc',
563             'src/processor/pathname_stripper.h',
564           ],
566           'include_dirs': [
567             'src',
568             'src/client',
569             'src/third_party/linux/include',
570             '..',
571             '.',
572           ],
573         },
574         {
575           # GN version: //breakpad:breakpad_unittests
576           'target_name': 'breakpad_unittests',
577           'type': 'executable',
578           'dependencies': [
579             '../testing/gtest.gyp:gtest',
580             '../testing/gtest.gyp:gtest_main',
581             '../testing/gmock.gyp:gmock',
582             'breakpad_client',
583             'breakpad_processor_support',
584             'linux_dumper_unittest_helper',
585           ],
586           'variables': {
587             'clang_warning_flags': [
588               # See http://crbug.com/138571#c18
589               '-Wno-unused-value',
590             ],
591           },
593           'sources': [
594             'linux/breakpad_googletest_includes.h',
595             'src/client/linux/handler/exception_handler_unittest.cc',
596             'src/client/linux/minidump_writer/cpu_set_unittest.cc',
597             'src/client/linux/minidump_writer/directory_reader_unittest.cc',
598             'src/client/linux/minidump_writer/line_reader_unittest.cc',
599             'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc',
600             'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc',
601             'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
602             'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc',
603             'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc',
604             'src/common/linux/elf_core_dump_unittest.cc',
605             'src/common/linux/file_id_unittest.cc',
606             'src/common/linux/linux_libc_support_unittest.cc',
607             'src/common/linux/synth_elf.cc',
608             'src/common/linux/tests/auto_testfile.h',
609             'src/common/linux/tests/crash_generator.cc',
610             'src/common/linux/tests/crash_generator.h',
611             'src/common/memory_range.h',
612             'src/common/memory_unittest.cc',
613             'src/common/simple_string_dictionary_unittest.cc',
614             'src/common/test_assembler.cc',
615             'src/common/tests/file_utils.cc',
616             'src/common/tests/file_utils.h',
617             'src/tools/linux/md2core/minidump_memory_range.h',
618             'src/tools/linux/md2core/minidump_memory_range_unittest.cc',
619           ],
621           'include_dirs': [
622             'linux', # Use our copy of breakpad_googletest_includes.h
623             'src',
624             '..',
625             '.',
626           ],
627           'conditions': [
628             ['OS=="android"', {
629               'libraries': [
630                 '-llog',
631               ],
632               'include_dirs': [
633                 'src/common/android/include',
634               ],
635               'sources': [
636                 'src/common/android/breakpad_getcontext_unittest.cc',
637               ],
638             }],
639           ],
640         },
641         {
642           # GN version: //breakpad:linux_dumper_unittest_helper
643           'target_name': 'linux_dumper_unittest_helper',
644           'type': 'executable',
645           'dependencies': [
646             'breakpad_processor_support',
647           ],
648           'sources': [
649             'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc',
650           ],
652           'include_dirs': [
653             'src',
654             '..',
655           ],
656           'conditions': [
657             ['target_arch=="mipsel" and OS=="android"', {
658               'include_dirs': [
659                 'src/common/android/include',
660               ],
661             }],
662           ],
663         },
664         {
665           # GN version: //breakpad:generate_test_dump
666           'target_name': 'generate_test_dump',
667           'type': 'executable',
669           'sources': [
670             'linux/generate-test-dump.cc',
671           ],
673           'dependencies': [
674             'breakpad_client',
675           ],
677           'include_dirs': [
678             '..',
679             'src',
680           ],
681           'conditions': [
682             ['OS=="android"', {
683               'libraries': [
684                 '-llog',
685               ],
686               'include_dirs': [
687                 'src/common/android/include',
688               ],
689             }],
690           ],
691         },
692         {
693           # GN version: //breakpad:minidump-2-core
694           'target_name': 'minidump-2-core',
695           'type': 'executable',
697           'sources': [
698             'src/tools/linux/md2core/minidump-2-core.cc'
699           ],
701           'dependencies': [
702             'breakpad_client',
703           ],
705           'include_dirs': [
706             '..',
707             'src',
708           ],
709         },
710         {
711           # GN version: //breakpad:core-2-minidump
712           'target_name': 'core-2-minidump',
713           'type': 'executable',
715           'sources': [
716             'src/tools/linux/core2md/core2md.cc'
717           ],
719           'dependencies': [
720             'breakpad_client',
721           ],
723           'include_dirs': [
724             '..',
725             'src',
726           ],
727         },
728       ],
729     }],
730     ['OS=="ios"', {
731       'targets': [
732         {
733           # GN version: //breakpad:client
734           'target_name': 'breakpad_client',
735           'type': 'static_library',
736           'sources': [
737             'src/client/ios/Breakpad.h',
738             'src/client/ios/Breakpad.mm',
739             'src/client/ios/BreakpadController.h',
740             'src/client/ios/BreakpadController.mm',
741             'src/client/ios/handler/ios_exception_minidump_generator.mm',
742             'src/client/ios/handler/ios_exception_minidump_generator.h',
743             'src/client/mac/crash_generation/ConfigFile.h',
744             'src/client/mac/crash_generation/ConfigFile.mm',
745             'src/client/mac/handler/breakpad_nlist_64.cc',
746             'src/client/mac/handler/breakpad_nlist_64.h',
747             'src/client/mac/handler/dynamic_images.cc',
748             'src/client/mac/handler/dynamic_images.h',
749             'src/client/mac/handler/protected_memory_allocator.cc',
750             'src/client/mac/handler/protected_memory_allocator.h',
751             'src/client/mac/handler/exception_handler.cc',
752             'src/client/mac/handler/exception_handler.h',
753             'src/client/mac/handler/minidump_generator.cc',
754             'src/client/mac/handler/minidump_generator.h',
755             'src/client/mac/sender/uploader.h',
756             'src/client/mac/sender/uploader.mm',
757             'src/client/minidump_file_writer.cc',
758             'src/client/minidump_file_writer.h',
759             'src/client/minidump_file_writer-inl.h',
760             'src/common/convert_UTF.c',
761             'src/common/convert_UTF.h',
762             'src/common/mac/file_id.cc',
763             'src/common/mac/file_id.h',
764             'src/common/mac/HTTPMultipartUpload.m',
765             'src/common/mac/macho_id.cc',
766             'src/common/mac/macho_id.h',
767             'src/common/mac/macho_utilities.cc',
768             'src/common/mac/macho_utilities.h',
769             'src/common/mac/macho_walker.cc',
770             'src/common/mac/macho_walker.h',
771             'src/common/mac/string_utilities.cc',
772             'src/common/mac/string_utilities.h',
773             'src/common/md5.cc',
774             'src/common/md5.h',
775             'src/common/simple_string_dictionary.cc',
776             'src/common/simple_string_dictionary.h',
777             'src/common/string_conversion.cc',
778             'src/common/string_conversion.h',
779             'src/google_breakpad/common/minidump_format.h',
780           ],
781           'include_dirs': [
782             'src',
783             'src/client/mac/Framework',
784             'src/common/mac',
785           ],
786         }
787       ]
788     }],
789     ['OS=="ios" and "<(GENERATOR)"!="ninja"', {
790       'variables': {
791         'ninja_output_dir': 'ninja-breakpad',
792         'ninja_product_dir':
793           '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
794       },
795       # Generation is done via two actions: (1) compiling the executable with
796       # ninja, and (2) copying the executable into a location that is shared
797       # with other projects. These actions are separated into two targets in
798       # order to be able to specify that the second action should not run until
799       # the first action finishes (since the ordering of multiple actions in
800       # one target is defined only by inputs and outputs, and it's impossible
801       # to set correct inputs for the ninja build, so setting all the inputs
802       # and outputs isn't an option).
803       'targets': [
804         {
805           'target_name': 'compile_breakpad_utilities',
806           'type': 'none',
807           'variables': {
808             # Gyp to rerun
809             're_run_targets': [
810               'breakpad/breakpad.gyp',
811             ],
812           },
813           'includes': ['../build/ios/mac_build.gypi'],
814           'actions': [
815             {
816               'action_name': 'compile breakpad utilities',
817               'inputs': [],
818               'outputs': [],
819               'action': [
820                 '<@(ninja_cmd)',
821                 'dump_syms',
822                 'symupload',
823               ],
824               'message': 'Generating the breakpad executables',
825             },
826           ],
827         },
828         {
829           'target_name': 'breakpad_utilities',
830           'type': 'none',
831           'dependencies': [
832             'compile_breakpad_utilities',
833           ],
834           'actions': [
835             {
836               'action_name': 'copy dump_syms',
837               'inputs': [
838                 '<(ninja_product_dir)/dump_syms',
839               ],
840               'outputs': [
841                 '<(PRODUCT_DIR)/dump_syms',
842               ],
843               'action': [
844                 'cp',
845                 '<(ninja_product_dir)/dump_syms',
846                 '<(PRODUCT_DIR)/dump_syms',
847               ],
848             },
849             {
850               'action_name': 'copy symupload',
851               'inputs': [
852                 '<(ninja_product_dir)/symupload',
853               ],
854               'outputs': [
855                 '<(PRODUCT_DIR)/symupload',
856               ],
857               'action': [
858                 'cp',
859                 '<(ninja_product_dir)/symupload',
860                 '<(PRODUCT_DIR)/symupload',
861               ],
862             },
863           ],
864         },
865         {
866           'target_name': 'dump_syms',
867           'type': 'none',
868           'dependencies': [
869             'breakpad_utilities',
870           ],
871         },
872         {
873           'target_name': 'symupload',
874           'type': 'none',
875           'dependencies': [
876             'breakpad_utilities',
877           ],
878         }
879       ],
880     }],
881     ['OS=="android"', {
882       'targets': [
883         {
884           'target_name': 'breakpad_unittests_stripped',
885           'type': 'none',
886           'dependencies': [ 'breakpad_unittests' ],
887           'actions': [{
888             'action_name': 'strip breakpad_unittests',
889             'inputs': [ '<(PRODUCT_DIR)/breakpad_unittests' ],
890             'outputs': [ '<(PRODUCT_DIR)/breakpad_unittests_stripped' ],
891             'action': [ '<(android_strip)', '<@(_inputs)', '-o', '<@(_outputs)' ],
892           }],
893         }
894       ],
895     }],
896   ],