Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / breakpad / breakpad.gyp
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.
4
5 {
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             ],
172
173             # The DWARF utilities require -funsigned-char.
174             'GCC_CHAR_IS_UNSIGNED_CHAR': 'YES',
175
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',
356
357           'includes': ['breakpad_tools.gypi'],
358
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           ],
382
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'],
388
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           ],
422
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           ],
429
430           'include_dirs': [
431             'src',
432             '..',
433           ],
434         },
435         {
436           'target_name': 'breakpad_client',
437           'type': 'static_library',
438
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           ],
489
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           ],
524
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',
537
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           ],
548
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           ],
568
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           ],
596
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             }],
618           ],
619         },
620         {
621           'target_name': 'linux_dumper_unittest_helper',
622           'type': 'executable',
623           'dependencies': [
624             'breakpad_processor_support',
625           ],
626           'sources': [
627             'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc',
628           ],
629
630           'include_dirs': [
631             'src',
632             '..',
633           ],
634           'conditions': [
635             ['target_arch=="mipsel" and OS=="android"', {
636               'include_dirs': [
637                 'src/common/android/include',
638               ],
639             }],
640           ],
641         },
642         {
643           'target_name': 'generate_test_dump',
644           'type': 'executable',
645
646           'sources': [
647             'linux/generate-test-dump.cc',
648           ],
649
650           'dependencies': [
651             'breakpad_client',
652           ],
653
654           'include_dirs': [
655             '..',
656             'src',
657           ],
658           'conditions': [
659             ['OS=="android"', {
660               'libraries': [
661                 '-llog',
662               ],
663               'include_dirs': [
664                 'src/common/android/include',
665               ],
666             }],
667           ],
668         },
669         {
670           'target_name': 'minidump-2-core',
671           'type': 'executable',
672
673           'sources': [
674             'src/tools/linux/md2core/minidump-2-core.cc'
675           ],
676
677           'dependencies': [
678             'breakpad_client',
679           ],
680
681           'include_dirs': [
682             '..',
683             'src',
684           ],
685         },
686         {
687           'target_name': 'core-2-minidump',
688           'type': 'executable',
689
690           'sources': [
691             'src/tools/linux/core2md/core2md.cc'
692           ],
693
694           'dependencies': [
695             'breakpad_client',
696           ],
697
698           'include_dirs': [
699             '..',
700             'src',
701           ],
702         },
703       ],
704     }],
705     ['OS=="ios"', {
706       'targets': [
707         {
708           'target_name': 'breakpad_client',
709           'type': 'static_library',
710           'sources': [
711             'src/client/ios/Breakpad.h',
712             'src/client/ios/Breakpad.mm',
713             'src/client/ios/BreakpadController.h',
714             'src/client/ios/BreakpadController.mm',
715             'src/client/ios/handler/ios_exception_minidump_generator.mm',
716             'src/client/ios/handler/ios_exception_minidump_generator.h',
717             'src/client/mac/crash_generation/ConfigFile.h',
718             'src/client/mac/crash_generation/ConfigFile.mm',
719             'src/client/mac/handler/breakpad_nlist_64.cc',
720             'src/client/mac/handler/breakpad_nlist_64.h',
721             'src/client/mac/handler/dynamic_images.cc',
722             'src/client/mac/handler/dynamic_images.h',
723             'src/client/mac/handler/protected_memory_allocator.cc',
724             'src/client/mac/handler/protected_memory_allocator.h',
725             'src/client/mac/handler/exception_handler.cc',
726             'src/client/mac/handler/exception_handler.h',
727             'src/client/mac/handler/minidump_generator.cc',
728             'src/client/mac/handler/minidump_generator.h',
729             'src/client/mac/sender/uploader.h',
730             'src/client/mac/sender/uploader.mm',
731             'src/client/minidump_file_writer.cc',
732             'src/client/minidump_file_writer.h',
733             'src/client/minidump_file_writer-inl.h',
734             'src/common/convert_UTF.c',
735             'src/common/convert_UTF.h',
736             'src/common/mac/file_id.cc',
737             'src/common/mac/file_id.h',
738             'src/common/mac/HTTPMultipartUpload.m',
739             'src/common/mac/macho_id.cc',
740             'src/common/mac/macho_id.h',
741             'src/common/mac/macho_utilities.cc',
742             'src/common/mac/macho_utilities.h',
743             'src/common/mac/macho_walker.cc',
744             'src/common/mac/macho_walker.h',
745             'src/common/mac/string_utilities.cc',
746             'src/common/mac/string_utilities.h',
747             'src/common/md5.cc',
748             'src/common/md5.h',
749             'src/common/simple_string_dictionary.cc',
750             'src/common/simple_string_dictionary.h',
751             'src/common/string_conversion.cc',
752             'src/common/string_conversion.h',
753             'src/google_breakpad/common/minidump_format.h',
754           ],
755           'include_dirs': [
756             'src',
757             'src/client/mac/Framework',
758             'src/common/mac',
759           ],
760         }
761       ]
762     }],
763     ['OS=="ios" and "<(GENERATOR)"!="ninja"', {
764       'variables': {
765         'ninja_output_dir': 'ninja-breakpad',
766         'ninja_product_dir':
767           '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
768       },
769       # Generation is done via two actions: (1) compiling the executable with
770       # ninja, and (2) copying the executable into a location that is shared
771       # with other projects. These actions are separated into two targets in
772       # order to be able to specify that the second action should not run until
773       # the first action finishes (since the ordering of multiple actions in
774       # one target is defined only by inputs and outputs, and it's impossible
775       # to set correct inputs for the ninja build, so setting all the inputs
776       # and outputs isn't an option).
777       'targets': [
778         {
779           'target_name': 'compile_breakpad_utilities',
780           'type': 'none',
781           'variables': {
782             # Gyp to rerun
783             're_run_targets': [
784               'breakpad/breakpad.gyp',
785             ],
786           },
787           'includes': ['../build/ios/mac_build.gypi'],
788           'actions': [
789             {
790               'action_name': 'compile breakpad utilities',
791               'inputs': [],
792               'outputs': [],
793               'action': [
794                 '<@(ninja_cmd)',
795                 'dump_syms',
796                 'symupload',
797               ],
798               'message': 'Generating the breakpad executables',
799             },
800           ],
801         },
802         {
803           'target_name': 'breakpad_utilities',
804           'type': 'none',
805           'dependencies': [
806             'compile_breakpad_utilities',
807           ],
808           'actions': [
809             {
810               'action_name': 'copy dump_syms',
811               'inputs': [
812                 '<(ninja_product_dir)/dump_syms',
813               ],
814               'outputs': [
815                 '<(PRODUCT_DIR)/dump_syms',
816               ],
817               'action': [
818                 'cp',
819                 '<(ninja_product_dir)/dump_syms',
820                 '<(PRODUCT_DIR)/dump_syms',
821               ],
822             },
823             {
824               'action_name': 'copy symupload',
825               'inputs': [
826                 '<(ninja_product_dir)/symupload',
827               ],
828               'outputs': [
829                 '<(PRODUCT_DIR)/symupload',
830               ],
831               'action': [
832                 'cp',
833                 '<(ninja_product_dir)/symupload',
834                 '<(PRODUCT_DIR)/symupload',
835               ],
836             },
837           ],
838         },
839         {
840           'target_name': 'dump_syms',
841           'type': 'none',
842           'dependencies': [
843             'breakpad_utilities',
844           ],
845         },
846         {
847           'target_name': 'symupload',
848           'type': 'none',
849           'dependencies': [
850             'breakpad_utilities',
851           ],
852         }
853       ],
854     }],
855     ['OS=="android"', {
856       'targets': [
857         {
858           'target_name': 'breakpad_unittests_stripped',
859           'type': 'none',
860           'dependencies': [ 'breakpad_unittests' ],
861           'actions': [{
862             'action_name': 'strip breakpad_unittests',
863             'inputs': [ '<(PRODUCT_DIR)/breakpad_unittests' ],
864             'outputs': [ '<(PRODUCT_DIR)/breakpad_unittests_stripped' ],
865             'action': [ '<(android_strip)', '<@(_inputs)', '-o', '<@(_outputs)' ],
866           }],
867         }
868       ],
869     }],
870   ],
871 }