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