Updating trunk VERSION from 993.0 to 994.0
[chromium-blink-merge.git] / breakpad / breakpad.gyp
blob695932f2a4dbaaa5a8c4bf4dec2e4fd19dd66dea
1 # Copyright (c) 2011 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/common/convert_UTF.c',
31             'src/client/mac/handler/breakpad_nlist_64.cc',
32             'src/client/mac/handler/dynamic_images.cc',
33             'src/common/mac/file_id.cc',
34             'src/common/mac/MachIPC.mm',
35             'src/common/mac/macho_id.cc',
36             'src/common/mac/macho_utilities.cc',
37             'src/common/mac/macho_walker.cc',
38             'src/client/minidump_file_writer.cc',
39             'src/client/mac/handler/minidump_generator.cc',
40             'src/common/mac/SimpleStringDictionary.mm',
41             'src/common/string_conversion.cc',
42             'src/common/mac/string_utilities.cc',
43             'src/common/md5.cc',
44           ],
45         },
46         {
47           'target_name': 'crash_inspector',
48           'type': 'executable',
49           'variables': {
50             'mac_real_dsym': 1,
51           },
52           'dependencies': [
53             'breakpad_utilities',
54           ],
55           'include_dirs': [
56             'src/client/apple/Framework',
57             'src/common/mac',
58           ],
59           'sources': [
60             'src/client/mac/crash_generation/ConfigFile.mm',
61             'src/client/mac/crash_generation/Inspector.mm',
62             'src/client/mac/crash_generation/InspectorMain.mm',
63           ],
64           'link_settings': {
65             'libraries': [
66               '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
67               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
68             ],
69           }
70         },
71         {
72           'target_name': 'crash_report_sender',
73           'type': 'executable',
74           'mac_bundle': 1,
75           'variables': {
76             'mac_real_dsym': 1,
77           },
78           'include_dirs': [
79             'src/common/mac',
80           ],
81           'sources': [
82             'src/common/mac/HTTPMultipartUpload.m',
83             'src/client/mac/sender/crash_report_sender.m',
84             'src/client/mac/sender/uploader.mm',
85             'src/common/mac/GTMLogger.m',
86           ],
87           'mac_bundle_resources': [
88             'src/client/mac/sender/English.lproj/Localizable.strings',
89             'src/client/mac/sender/crash_report_sender.icns',
90             'src/client/mac/sender/Breakpad.xib',
91             'src/client/mac/sender/crash_report_sender-Info.plist',
92           ],
93           'mac_bundle_resources!': [
94              'src/client/mac/sender/crash_report_sender-Info.plist',
95           ],
96           'xcode_settings': {
97              'INFOPLIST_FILE': 'src/client/mac/sender/crash_report_sender-Info.plist',
98           },
99           'link_settings': {
100             'libraries': [
101               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
102               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
103               '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
104             ],
105           }
106         },
107         {
108           'target_name': 'dump_syms',
109           'type': 'executable',
110           'include_dirs++': [
111             # ++ ensures this comes before src brought in from target_defaults.
112             'pending/src',
113           ],
114           'include_dirs': [
115             'src/common/mac',
116           ],
117           'sources': [
118             'src/common/dwarf/dwarf2diehandler.cc',
119             'src/common/dwarf/dwarf2reader.cc',
120             'src/common/dwarf/bytereader.cc',
121             'src/common/dwarf_cfi_to_module.cc',
122             'pending/src/common/dwarf_cu_to_module.cc',
123             'src/common/dwarf_line_to_module.cc',
124             'src/common/language.cc',
125             'pending/src/common/module.cc',
126             'src/common/mac/dump_syms.mm',
127             'src/common/mac/file_id.cc',
128             'src/common/mac/macho_id.cc',
129             'src/common/mac/macho_reader.cc',
130             'src/common/mac/macho_utilities.cc',
131             'src/common/mac/macho_walker.cc',
132             'src/common/stabs_reader.cc',
133             'src/common/stabs_to_module.cc',
134             'src/tools/mac/dump_syms/dump_syms_tool.mm',
135             'src/common/md5.cc',
136           ],
137           'defines': [
138             # For src/common/stabs_reader.h.
139             'HAVE_MACH_O_NLIST_H',
140           ],
141           'xcode_settings': {
142             # Like ld, dump_syms needs to operate on enough data that it may
143             # actually need to be able to address more than 4GB. Use x86_64.
144             # Don't worry! An x86_64 dump_syms is perfectly able to dump
145             # 32-bit files.
146             'ARCHS': [
147               'x86_64',
148             ],
150             # The DWARF utilities require -funsigned-char.
151             'GCC_CHAR_IS_UNSIGNED_CHAR': 'YES',
153             # dwarf2reader.cc uses dynamic_cast.
154             'GCC_ENABLE_CPP_RTTI': 'YES',
155           },
156           'link_settings': {
157             'libraries': [
158               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
159             ],
160           },
161           'configurations': {
162             'Release_Base': {
163               'xcode_settings': {
164                 # dump_syms crashes when built at -O1, -O2, and -O3.  It does
165                 # not crash at -Os.  To play it safe, dump_syms is always built
166                 # at -O0 until this can be sorted out.
167                 # http://code.google.com/p/google-breakpad/issues/detail?id=329
168                 'GCC_OPTIMIZATION_LEVEL': '0',  # -O0
169                },
170              },
171           },
172         },
173         {
174           'target_name': 'symupload',
175           'type': 'executable',
176           'include_dirs': [
177             'src/common/mac',
178           ],
179           'sources': [
180             'src/common/mac/HTTPMultipartUpload.m',
181             'src/tools/mac/symupload/symupload.m',
182           ],
183           'link_settings': {
184             'libraries': [
185               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
186             ],
187           }
188         },
189         {
190           'target_name': 'breakpad',
191           'type': 'static_library',
192           'dependencies': [
193             'breakpad_utilities',
194             'crash_inspector',
195             'crash_report_sender',
196           ],
197           'include_dirs': [
198             'src/client/apple/Framework',
199           ],
200           'direct_dependent_settings': {
201             'include_dirs': [
202               'src/client/apple/Framework',
203             ],
204           },
205           'defines': [
206             'USE_PROTECTED_ALLOCATIONS=1',
207           ],
208           'sources': [
209             'src/client/mac/crash_generation/crash_generation_client.cc',
210             'src/client/mac/crash_generation/crash_generation_client.h',
211             'src/client/mac/handler/protected_memory_allocator.cc',
212             'src/client/mac/handler/exception_handler.cc',
213             'src/client/mac/Framework/Breakpad.mm',
214             'src/client/mac/Framework/OnDemandServer.mm',
215           ],
216         },
217       ],
218     }],
219     [ 'OS=="linux"', {
220       'conditions': [
221         # Tools needed for archiving build symbols.
222         ['linux_breakpad==1', {
223           'targets': [
224             {
225               'target_name': 'symupload',
226               'type': 'executable',
228               # This uses the system libcurl, so don't use the default 32-bit
229               # compile flags when building on a 64-bit machine.
230               'variables': {
231                 'host_arch': '<!(uname -m)',
232               },
233               'conditions': [
234                 ['host_arch=="x86_64"', {
235                   'cflags!': ['-m32', '-march=pentium4', '-msse2',
236                               '-mfpmath=sse'],
237                   'ldflags!': ['-m32'],
238                   'cflags': ['-O2'],
239                   'include_dirs!': ['/usr/include32'],
240                 }],
241               ],
243               'sources': [
244                 'src/tools/linux/symupload/sym_upload.cc',
245                 'src/common/linux/http_upload.cc',
246                 'src/common/linux/http_upload.h',
247               ],
248               'include_dirs': [
249                 'src',
250               ],
251               'link_settings': {
252                 'libraries': [
253                   '-ldl',
254                 ],
255               },
256             },
257             {
258               'target_name': 'dump_syms',
259               'type': 'executable',
261               # dwarf2reader.cc uses dynamic_cast. Because we don't typically
262               # don't support RTTI, we enable it for this single target. Since
263               # dump_syms doesn't share any object files with anything else,
264               # this doesn't end up polluting Chrome itself.
265               'cflags_cc!': ['-fno-rtti'],
267               'sources': [
268                 'src/common/dwarf/bytereader.cc',
269                 'src/common/dwarf_cfi_to_module.cc',
270                 'src/common/dwarf_cfi_to_module.h',
271                 'src/common/dwarf_cu_to_module.cc',
272                 'src/common/dwarf_cu_to_module.h',
273                 'src/common/dwarf/dwarf2diehandler.cc',
274                 'src/common/dwarf/dwarf2reader.cc',
275                 'src/common/dwarf_line_to_module.cc',
276                 'src/common/dwarf_line_to_module.h',
277                 'src/common/language.cc',
278                 'src/common/language.h',
279                 'src/common/linux/dump_symbols.cc',
280                 'src/common/linux/dump_symbols.h',
281                 'src/common/linux/elf_symbols_to_module.cc',
282                 'src/common/linux/elf_symbols_to_module.h',
283                 'src/common/linux/file_id.cc',
284                 'src/common/linux/file_id.h',
285                 'src/common/linux/memory_mapped_file.cc',
286                 'src/common/linux/memory_mapped_file.h',
287                 'src/common/linux/guid_creator.h',
288                 'src/common/module.cc',
289                 'src/common/module.h',
290                 'src/common/stabs_reader.cc',
291                 'src/common/stabs_reader.h',
292                 'src/common/stabs_to_module.cc',
293                 'src/common/stabs_to_module.h',
294                 'src/tools/linux/dump_syms/dump_syms.cc',
295               ],
297               # Breakpad rev 583 introduced this flag.
298               # Using this define, stabs_reader.h will include a.out.h to
299               # build on Linux.
300               'defines': [
301                 'HAVE_A_OUT_H',
302               ],
304               'include_dirs': [
305                 'src',
306                 '..',
307               ],
308             },
309           ],
310         }],
311       ],
312       'targets': [
313         {
314           'target_name': 'breakpad_client',
315           'type': 'static_library',
317           'sources': [
318             'src/client/linux/crash_generation/crash_generation_client.cc',
319             'src/client/linux/crash_generation/crash_generation_client.h',
320             'src/client/linux/handler/exception_handler.cc',
321             'src/client/linux/minidump_writer/directory_reader.h',
322             'src/client/linux/minidump_writer/line_reader.h',
323             'src/client/linux/minidump_writer/linux_dumper.cc',
324             'src/client/linux/minidump_writer/linux_dumper.h',
325             'src/client/linux/minidump_writer/minidump_writer.cc',
326             'src/client/linux/minidump_writer/minidump_writer.h',
327             'src/client/minidump_file_writer-inl.h',
328             'src/client/minidump_file_writer.cc',
329             'src/client/minidump_file_writer.h',
330             'src/common/convert_UTF.c',
331             'src/common/convert_UTF.h',
332             'src/common/linux/file_id.cc',
333             'src/common/linux/file_id.h',
334             'src/common/linux/google_crashdump_uploader.cc',
335             'src/common/linux/google_crashdump_uploader.h',
336             'src/common/linux/guid_creator.cc',
337             'src/common/linux/guid_creator.h',
338             'src/common/linux/libcurl_wrapper.cc',
339             'src/common/linux/libcurl_wrapper.h',
340             'src/common/linux/linux_libc_support.h',
341             'src/common/linux/memory_mapped_file.cc',
342             'src/common/linux/memory_mapped_file.h',
343             'src/common/linux/safe_readlink.cc',
344             'src/common/linux/safe_readlink.h',
345             'src/common/memory.h',
346             'src/common/string_conversion.cc',
347             'src/common/string_conversion.h',
348           ],
350           'conditions': [
351             ['target_arch=="arm"', {
352               'cflags': ['-Wa,-mimplicit-it=always'],
353             }],
354           ],
356           'link_settings': {
357             'libraries': [
358               '-ldl',
359             ],
360           },
362           'include_dirs': [
363             'src',
364             'src/client',
365             'src/third_party/linux/include',
366             '..',
367             '.',
368           ],
369         },
370         {
371           # Breakpad r693 uses some files from src/processor in unit tests.
372           'target_name': 'breakpad_processor_support',
373           'type': 'static_library',
375           'sources': [
376             'src/processor/basic_code_modules.cc',
377             'src/processor/basic_code_modules.h',
378             'src/processor/logging.cc',
379             'src/processor/logging.h',
380             'src/processor/minidump.cc',
381             'src/processor/pathname_stripper.cc',
382             'src/processor/pathname_stripper.h',
383           ],
385           'include_dirs': [
386             'src',
387             'src/client',
388             'src/third_party/linux/include',
389             '..',
390             '.',
391           ],
392         },
393         {
394           'target_name': 'breakpad_unittests',
395           'type': 'executable',
396           'dependencies': [
397             '../testing/gtest.gyp:gtest',
398             '../testing/gtest.gyp:gtest_main',
399             '../testing/gmock.gyp:gmock',
400             'breakpad_client',
401             'breakpad_processor_support',
402           ],
404           'sources': [
405             'linux/breakpad_googletest_includes.h',
406             'src/client/linux/handler/exception_handler_unittest.cc',
407             'src/client/linux/minidump_writer/directory_reader_unittest.cc',
408             'src/client/linux/minidump_writer/line_reader_unittest.cc',
409             'src/client/linux/minidump_writer/linux_dumper_unittest.cc',
410             'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
411             'src/common/linux/file_id_unittest.cc',
412             'src/common/linux/linux_libc_support_unittest.cc',
413             'src/common/linux/synth_elf.cc',
414             'src/common/memory_unittest.cc',
415             'src/common/test_assembler.cc',
416           ],
418           'include_dirs': [
419             'linux', # Use our copy of breakpad_googletest_includes.h
420             'src',
421             '..',
422             '.',
423           ],
424         },
425         {
426           'target_name': 'generate_test_dump',
427           'type': 'executable',
429           'sources': [
430             'linux/generate-test-dump.cc',
431           ],
433           'dependencies': [
434             'breakpad_client',
435           ],
437           'include_dirs': [
438             '..',
439             'src',
440           ],
441         },
442         {
443           'target_name': 'minidump-2-core',
444           'type': 'executable',
446           'sources': [
447             'src/tools/linux/md2core/minidump-2-core.cc'
448           ],
450           'dependencies': [
451             'breakpad_client',
452           ],
454           'include_dirs': [
455             '..',
456             'src',
457           ],
458         },
459       ],
460     }],
461   ],