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