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