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