gn vim: apply to *.gni also
[chromium-blink-merge.git] / breakpad / breakpad.gyp
blobcda18dda0eccd509496e0159895b545e6dbc82f0
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           'conditions': [
263             ['OS=="ios"', {
264               'xcode_settings' : {
265                 'WARNING_CFLAGS': [
266                   # MinidumpGenerator uses an API deprecated in iOS 7.
267                   # crbug.com/408562
268                   '-Wno-deprecated-declarations',
269                 ],
270               },
271             }],
272           ],
273         },
274         {
275           # GN version: //breakpad:crash_inspector
276           'target_name': 'crash_inspector',
277           'type': 'executable',
278           'variables': {
279             'mac_real_dsym': 1,
280           },
281           'dependencies': [
282             'breakpad_utilities',
283           ],
284           'include_dirs': [
285             'src/client/apple/Framework',
286             'src/common/mac',
287           ],
288           'sources': [
289             'src/client/mac/crash_generation/Inspector.mm',
290             'src/client/mac/crash_generation/InspectorMain.mm',
291           ],
292           'link_settings': {
293             'libraries': [
294               '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
295               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
296             ],
297           }
298         },
299         {
300           # GN version: //breakpad:crash_report_sender
301           'target_name': 'crash_report_sender',
302           'type': 'executable',
303           'mac_bundle': 1,
304           'variables': {
305             'mac_real_dsym': 1,
306           },
307           'include_dirs': [
308             'src/common/mac',
309           ],
310           'sources': [
311             'src/common/mac/HTTPMultipartUpload.m',
312             'src/client/mac/sender/crash_report_sender.m',
313             'src/client/mac/sender/uploader.mm',
314             'src/common/mac/GTMLogger.m',
315           ],
316           'mac_bundle_resources': [
317             'src/client/mac/sender/English.lproj/Localizable.strings',
318             'src/client/mac/sender/crash_report_sender.icns',
319             'src/client/mac/sender/Breakpad.xib',
320             'src/client/mac/sender/crash_report_sender-Info.plist',
321           ],
322           'mac_bundle_resources!': [
323              'src/client/mac/sender/crash_report_sender-Info.plist',
324           ],
325           'xcode_settings': {
326              'INFOPLIST_FILE': 'src/client/mac/sender/crash_report_sender-Info.plist',
327           },
328           'link_settings': {
329             'libraries': [
330               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
331               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
332               '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
333             ],
334           }
335         },
336         {
337           # GN version: //breakpad
338           'target_name': 'breakpad',
339           'type': 'static_library',
340           'dependencies': [
341             'breakpad_utilities',
342             'crash_inspector',
343             'crash_report_sender',
344           ],
345           'include_dirs': [
346             'src/client/apple/Framework',
347           ],
348           'direct_dependent_settings': {
349             'include_dirs': [
350               'src/client/apple/Framework',
351             ],
352           },
353           'defines': [
354             'USE_PROTECTED_ALLOCATIONS=1',
355           ],
356           'sources': [
357             'src/client/mac/crash_generation/crash_generation_client.cc',
358             'src/client/mac/crash_generation/crash_generation_client.h',
359             'src/client/mac/handler/protected_memory_allocator.cc',
360             'src/client/mac/handler/exception_handler.cc',
361             'src/client/mac/Framework/Breakpad.mm',
362             'src/client/mac/Framework/OnDemandServer.mm',
363           ],
364         },
365       ],
366     }],
367     [ 'OS=="linux" or OS=="android" or OS=="freebsd"', {
368       'conditions': [
369         ['OS=="android"', {
370           'defines': [
371             '__ANDROID__',
372           ],
373         }],
374       ],
375       # Tools needed for archiving build symbols.
376       'targets': [
377         {
378           # GN version: //breakpad:symupload
379           'target_name': 'symupload',
380           'type': 'executable',
382           'includes': ['breakpad_tools.gypi'],
384           'sources': [
385             'src/tools/linux/symupload/sym_upload.cc',
386             'src/common/linux/http_upload.cc',
387             'src/common/linux/http_upload.h',
388           ],
389           'include_dirs': [
390             'src',
391             'src/third_party',
392           ],
393           'link_settings': {
394             'libraries': [
395               '-ldl',
396             ],
397           },
398         },
399         {
400           # GN version: //breakpad:dump_syms
401           'target_name': 'dump_syms',
402           'type': 'executable',
403           'conditions': [
404             ['OS=="android"', {
405               'toolsets': [ 'host' ],
406             }],
407           ],
409           # dwarf2reader.cc uses dynamic_cast. Because we don't typically
410           # don't support RTTI, we enable it for this single target. Since
411           # dump_syms doesn't share any object files with anything else,
412           # this doesn't end up polluting Chrome itself.
413           'cflags_cc!': ['-fno-rtti'],
415           'sources': [
416             'src/common/dwarf/bytereader.cc',
417             'src/common/dwarf_cfi_to_module.cc',
418             'src/common/dwarf_cfi_to_module.h',
419             'src/common/dwarf_cu_to_module.cc',
420             'src/common/dwarf_cu_to_module.h',
421             'src/common/dwarf/dwarf2diehandler.cc',
422             'src/common/dwarf/dwarf2reader.cc',
423             'src/common/dwarf_line_to_module.cc',
424             'src/common/dwarf_line_to_module.h',
425             'src/common/language.cc',
426             'src/common/language.h',
427             'src/common/linux/crc32.cc',
428             'src/common/linux/crc32.h',
429             'src/common/linux/dump_symbols.cc',
430             'src/common/linux/dump_symbols.h',
431             'src/common/linux/elf_symbols_to_module.cc',
432             'src/common/linux/elf_symbols_to_module.h',
433             'src/common/linux/elfutils.cc',
434             'src/common/linux/elfutils.h',
435             'src/common/linux/file_id.cc',
436             'src/common/linux/file_id.h',
437             'src/common/linux/linux_libc_support.cc',
438             'src/common/linux/linux_libc_support.h',
439             'src/common/linux/memory_mapped_file.cc',
440             'src/common/linux/memory_mapped_file.h',
441             'src/common/linux/guid_creator.h',
442             'src/common/module.cc',
443             'src/common/module.h',
444             'src/common/stabs_reader.cc',
445             'src/common/stabs_reader.h',
446             'src/common/stabs_to_module.cc',
447             'src/common/stabs_to_module.h',
448             'src/tools/linux/dump_syms/dump_syms.cc',
449           ],
451           # Breakpad rev 583 introduced this flag.
452           # Using this define, stabs_reader.h will include a.out.h to
453           # build on Linux.
454           'defines': [
455             'HAVE_A_OUT_H',
456           ],
458           'include_dirs': [
459             'src',
460             '..',
461           ],
462         },
463         {
464           # GN version: //breakpad:client
465           'target_name': 'breakpad_client',
466           'type': 'static_library',
468           'sources': [
469             'src/client/linux/crash_generation/crash_generation_client.cc',
470             'src/client/linux/crash_generation/crash_generation_client.h',
471             'src/client/linux/handler/exception_handler.cc',
472             'src/client/linux/handler/exception_handler.h',
473             'src/client/linux/handler/minidump_descriptor.cc',
474             'src/client/linux/handler/minidump_descriptor.h',
475             'src/client/linux/log/log.cc',
476             'src/client/linux/log/log.h',
477             'src/client/linux/dump_writer_common/mapping_info.h',
478             'src/client/linux/dump_writer_common/seccomp_unwinder.cc',
479             'src/client/linux/dump_writer_common/seccomp_unwinder.h',
480             'src/client/linux/dump_writer_common/thread_info.cc',
481             'src/client/linux/dump_writer_common/thread_info.h',
482             'src/client/linux/dump_writer_common/ucontext_reader.cc',
483             'src/client/linux/dump_writer_common/ucontext_reader.h',
484             'src/client/linux/minidump_writer/cpu_set.h',
485             'src/client/linux/minidump_writer/directory_reader.h',
486             'src/client/linux/minidump_writer/line_reader.h',
487             'src/client/linux/minidump_writer/linux_core_dumper.cc',
488             'src/client/linux/minidump_writer/linux_core_dumper.h',
489             'src/client/linux/minidump_writer/linux_dumper.cc',
490             'src/client/linux/minidump_writer/linux_dumper.h',
491             'src/client/linux/minidump_writer/linux_ptrace_dumper.cc',
492             'src/client/linux/minidump_writer/linux_ptrace_dumper.h',
493             'src/client/linux/minidump_writer/minidump_writer.cc',
494             'src/client/linux/minidump_writer/minidump_writer.h',
495             'src/client/linux/minidump_writer/proc_cpuinfo_reader.h',
496             'src/client/minidump_file_writer-inl.h',
497             'src/client/minidump_file_writer.cc',
498             'src/client/minidump_file_writer.h',
499             'src/common/convert_UTF.c',
500             'src/common/convert_UTF.h',
501             'src/common/linux/elf_core_dump.cc',
502             'src/common/linux/elf_core_dump.h',
503             'src/common/linux/elfutils.cc',
504             'src/common/linux/elfutils.h',
505             'src/common/linux/file_id.cc',
506             'src/common/linux/file_id.h',
507             'src/common/linux/google_crashdump_uploader.cc',
508             'src/common/linux/google_crashdump_uploader.h',
509             'src/common/linux/guid_creator.cc',
510             'src/common/linux/guid_creator.h',
511             'src/common/linux/libcurl_wrapper.cc',
512             'src/common/linux/libcurl_wrapper.h',
513             'src/common/linux/linux_libc_support.cc',
514             'src/common/linux/linux_libc_support.h',
515             'src/common/linux/memory_mapped_file.cc',
516             'src/common/linux/memory_mapped_file.h',
517             'src/common/linux/safe_readlink.cc',
518             'src/common/linux/safe_readlink.h',
519             'src/common/memory.h',
520             'src/common/simple_string_dictionary.cc',
521             'src/common/simple_string_dictionary.h',
522             'src/common/string_conversion.cc',
523             'src/common/string_conversion.h',
524           ],
526           'conditions': [
527             ['target_arch=="arm" and chromeos==1', {
528               # Avoid running out of registers in
529               # linux_syscall_support.h:sys_clone()'s inline assembly.
530               'cflags': ['-marm'],
531             }],
532             ['OS=="android"', {
533               'include_dirs': [
534                 'src/common/android/include',
535               ],
536               'direct_dependent_settings': {
537                 'include_dirs': [
538                   'src/common/android/include',
539                 ],
540               },
541               'sources': [
542                 'src/common/android/breakpad_getcontext.S',
543               ],
544             }],
545             ['OS!="android"', {
546               'link_settings': {
547                 'libraries': [
548                   # In case of Android, '-ldl' is added in common.gypi, since it
549                   # is needed for stlport_static. For LD, the order of libraries
550                   # is important, and thus we skip to add it here.
551                   '-ldl',
552                 ],
553               },
554             }],
555           ],
557           'include_dirs': [
558             'src',
559             'src/client',
560             'src/third_party/linux/include',
561             '..',
562             '.',
563           ],
564         },
565         {
566           # Breakpad r693 uses some files from src/processor in unit tests.
567           # GN version: //breakpad:processor_support
568           'target_name': 'breakpad_processor_support',
569           'type': 'static_library',
571           'sources': [
572             'src/common/scoped_ptr.h',
573             'src/processor/basic_code_modules.cc',
574             'src/processor/basic_code_modules.h',
575             'src/processor/dump_context.cc',
576             'src/processor/dump_object.cc',
577             'src/processor/logging.cc',
578             'src/processor/logging.h',
579             'src/processor/minidump.cc',
580             'src/processor/pathname_stripper.cc',
581             'src/processor/pathname_stripper.h',
582           ],
584           'include_dirs': [
585             'src',
586             'src/client',
587             'src/third_party/linux/include',
588             '..',
589             '.',
590           ],
591         },
592         {
593           # GN version: //breakpad:breakpad_unittests
594           'target_name': 'breakpad_unittests',
595           'type': 'executable',
596           'dependencies': [
597             '../testing/gtest.gyp:gtest',
598             '../testing/gtest.gyp:gtest_main',
599             '../testing/gmock.gyp:gmock',
600             'breakpad_client',
601             'breakpad_processor_support',
602             'linux_dumper_unittest_helper',
603           ],
604           'variables': {
605             'clang_warning_flags': [
606               # See http://crbug.com/138571#c18
607               '-Wno-unused-value',
608             ],
609           },
611           'sources': [
612             'linux/breakpad_googletest_includes.h',
613             'src/client/linux/handler/exception_handler_unittest.cc',
614             'src/client/linux/minidump_writer/cpu_set_unittest.cc',
615             'src/client/linux/minidump_writer/directory_reader_unittest.cc',
616             'src/client/linux/minidump_writer/line_reader_unittest.cc',
617             'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc',
618             'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc',
619             'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
620             'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc',
621             'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc',
622             'src/common/linux/elf_core_dump_unittest.cc',
623             'src/common/linux/file_id_unittest.cc',
624             'src/common/linux/linux_libc_support_unittest.cc',
625             'src/common/linux/synth_elf.cc',
626             'src/common/linux/tests/auto_testfile.h',
627             'src/common/linux/tests/crash_generator.cc',
628             'src/common/linux/tests/crash_generator.h',
629             'src/common/memory_range.h',
630             'src/common/memory_unittest.cc',
631             'src/common/simple_string_dictionary_unittest.cc',
632             'src/common/test_assembler.cc',
633             'src/common/tests/file_utils.cc',
634             'src/common/tests/file_utils.h',
635             'src/tools/linux/md2core/minidump_memory_range.h',
636             'src/tools/linux/md2core/minidump_memory_range_unittest.cc',
637           ],
639           'include_dirs': [
640             'linux', # Use our copy of breakpad_googletest_includes.h
641             'src',
642             '..',
643             '.',
644           ],
645           'conditions': [
646             ['OS=="android"', {
647               'libraries': [
648                 '-llog',
649               ],
650               'include_dirs': [
651                 'src/common/android/include',
652               ],
653               'sources': [
654                 'src/common/android/breakpad_getcontext_unittest.cc',
655               ],
656             }],
657           ],
658         },
659         {
660           # GN version: //breakpad:linux_dumper_unittest_helper
661           'target_name': 'linux_dumper_unittest_helper',
662           'type': 'executable',
663           'dependencies': [
664             'breakpad_processor_support',
665           ],
666           'sources': [
667             'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc',
668           ],
670           'include_dirs': [
671             'src',
672             '..',
673           ],
674           'conditions': [
675             ['target_arch=="mipsel" and OS=="android"', {
676               'include_dirs': [
677                 'src/common/android/include',
678               ],
679             }],
680           ],
681         },
682         {
683           # GN version: //breakpad:generate_test_dump
684           'target_name': 'generate_test_dump',
685           'type': 'executable',
687           'sources': [
688             'linux/generate-test-dump.cc',
689           ],
691           'dependencies': [
692             'breakpad_client',
693           ],
695           'include_dirs': [
696             '..',
697             'src',
698           ],
699           'conditions': [
700             ['OS=="android"', {
701               'libraries': [
702                 '-llog',
703               ],
704               'include_dirs': [
705                 'src/common/android/include',
706               ],
707             }],
708           ],
709         },
710         {
711           # GN version: //breakpad:minidump-2-core
712           'target_name': 'minidump-2-core',
713           'type': 'executable',
715           'sources': [
716             'src/tools/linux/md2core/minidump-2-core.cc'
717           ],
719           'dependencies': [
720             'breakpad_client',
721           ],
723           'include_dirs': [
724             '..',
725             'src',
726           ],
727         },
728         {
729           # GN version: //breakpad:core-2-minidump
730           'target_name': 'core-2-minidump',
731           'type': 'executable',
733           'sources': [
734             'src/tools/linux/core2md/core2md.cc'
735           ],
737           'dependencies': [
738             'breakpad_client',
739           ],
741           'include_dirs': [
742             '..',
743             'src',
744           ],
745         },
746       ],
747     }],
748     ['OS=="ios"', {
749       'targets': [
750         {
751           # GN version: //breakpad:client
752           'target_name': 'breakpad_client',
753           'type': 'static_library',
754           'sources': [
755             'src/client/ios/Breakpad.h',
756             'src/client/ios/Breakpad.mm',
757             'src/client/ios/BreakpadController.h',
758             'src/client/ios/BreakpadController.mm',
759             'src/client/ios/handler/ios_exception_minidump_generator.mm',
760             'src/client/ios/handler/ios_exception_minidump_generator.h',
761             'src/client/mac/crash_generation/ConfigFile.h',
762             'src/client/mac/crash_generation/ConfigFile.mm',
763             'src/client/mac/handler/breakpad_nlist_64.cc',
764             'src/client/mac/handler/breakpad_nlist_64.h',
765             'src/client/mac/handler/dynamic_images.cc',
766             'src/client/mac/handler/dynamic_images.h',
767             'src/client/mac/handler/protected_memory_allocator.cc',
768             'src/client/mac/handler/protected_memory_allocator.h',
769             'src/client/mac/handler/exception_handler.cc',
770             'src/client/mac/handler/exception_handler.h',
771             'src/client/mac/handler/minidump_generator.cc',
772             'src/client/mac/handler/minidump_generator.h',
773             'src/client/mac/sender/uploader.h',
774             'src/client/mac/sender/uploader.mm',
775             'src/client/minidump_file_writer.cc',
776             'src/client/minidump_file_writer.h',
777             'src/client/minidump_file_writer-inl.h',
778             'src/common/convert_UTF.c',
779             'src/common/convert_UTF.h',
780             'src/common/mac/file_id.cc',
781             'src/common/mac/file_id.h',
782             'src/common/mac/HTTPMultipartUpload.m',
783             'src/common/mac/macho_id.cc',
784             'src/common/mac/macho_id.h',
785             'src/common/mac/macho_utilities.cc',
786             'src/common/mac/macho_utilities.h',
787             'src/common/mac/macho_walker.cc',
788             'src/common/mac/macho_walker.h',
789             'src/common/mac/string_utilities.cc',
790             'src/common/mac/string_utilities.h',
791             'src/common/md5.cc',
792             'src/common/md5.h',
793             'src/common/simple_string_dictionary.cc',
794             'src/common/simple_string_dictionary.h',
795             'src/common/string_conversion.cc',
796             'src/common/string_conversion.h',
797             'src/google_breakpad/common/minidump_format.h',
798           ],
799           'include_dirs': [
800             'src',
801             'src/client/mac/Framework',
802             'src/common/mac',
803           ],
804         }
805       ]
806     }],
807     ['OS=="ios" and "<(GENERATOR)"!="ninja"', {
808       'variables': {
809         'ninja_output_dir': 'ninja-breakpad',
810         'ninja_product_dir':
811           '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
812       },
813       # Generation is done via two actions: (1) compiling the executable with
814       # ninja, and (2) copying the executable into a location that is shared
815       # with other projects. These actions are separated into two targets in
816       # order to be able to specify that the second action should not run until
817       # the first action finishes (since the ordering of multiple actions in
818       # one target is defined only by inputs and outputs, and it's impossible
819       # to set correct inputs for the ninja build, so setting all the inputs
820       # and outputs isn't an option).
821       'targets': [
822         {
823           'target_name': 'compile_breakpad_utilities',
824           'type': 'none',
825           'variables': {
826             # Gyp to rerun
827             're_run_targets': [
828               'breakpad/breakpad.gyp',
829             ],
830           },
831           'includes': ['../build/ios/mac_build.gypi'],
832           'actions': [
833             {
834               'action_name': 'compile breakpad utilities',
835               'inputs': [],
836               'outputs': [],
837               'action': [
838                 '<@(ninja_cmd)',
839                 'dump_syms',
840                 'symupload',
841               ],
842               'message': 'Generating the breakpad executables',
843             },
844           ],
845         },
846         {
847           'target_name': 'breakpad_utilities',
848           'type': 'none',
849           'dependencies': [
850             'compile_breakpad_utilities',
851           ],
852           'actions': [
853             {
854               'action_name': 'copy dump_syms',
855               'inputs': [
856                 '<(ninja_product_dir)/dump_syms',
857               ],
858               'outputs': [
859                 '<(PRODUCT_DIR)/dump_syms',
860               ],
861               'action': [
862                 'cp',
863                 '<(ninja_product_dir)/dump_syms',
864                 '<(PRODUCT_DIR)/dump_syms',
865               ],
866             },
867             {
868               'action_name': 'copy symupload',
869               'inputs': [
870                 '<(ninja_product_dir)/symupload',
871               ],
872               'outputs': [
873                 '<(PRODUCT_DIR)/symupload',
874               ],
875               'action': [
876                 'cp',
877                 '<(ninja_product_dir)/symupload',
878                 '<(PRODUCT_DIR)/symupload',
879               ],
880             },
881           ],
882         },
883         {
884           'target_name': 'dump_syms',
885           'type': 'none',
886           'dependencies': [
887             'breakpad_utilities',
888           ],
889         },
890         {
891           'target_name': 'symupload',
892           'type': 'none',
893           'dependencies': [
894             'breakpad_utilities',
895           ],
896         }
897       ],
898     }],
899     ['OS=="android"', {
900       'targets': [
901         {
902           'target_name': 'breakpad_unittests_stripped',
903           'type': 'none',
904           'dependencies': [ 'breakpad_unittests' ],
905           'actions': [{
906             'action_name': 'strip breakpad_unittests',
907             'inputs': [ '<(PRODUCT_DIR)/breakpad_unittests' ],
908             'outputs': [ '<(PRODUCT_DIR)/breakpad_unittests_stripped' ],
909             'action': [ '<(android_strip)', '<@(_inputs)', '-o', '<@(_outputs)' ],
910           }],
911         },
912         {
913           'target_name': 'breakpad_unittests_deps',
914           'type': 'none',
915           'dependencies': [
916             'breakpad_unittests_stripped',
917           ],
918           # For the component build, ensure dependent shared libraries are
919           # stripped and put alongside breakpad_unittest to simplify pushing to
920           # the device.
921           'variables': {
922              'output_dir': '<(PRODUCT_DIR)/breakpad_unittests_deps/',
923              'native_binary': '<(PRODUCT_DIR)/breakpad_unittests_stripped',
924              'include_main_binary': 0,
925           },
926           'includes': [
927             '../build/android/native_app_dependencies.gypi'
928           ],
929         }
930       ],
931     }],
932   ],