Initialized variables passed to GL functions. Command buffer now only allows initiali...
[chromium-blink-merge.git] / breakpad / breakpad.gyp
blob66ddc687e6b3bb5086a76e01fe5fff308332d3bc
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           ],
44           'link_settings': {
45             'libraries': ['$(SDKROOT)/usr/lib/libcrypto.dylib'],
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/common/mac',
59           ],
60           'sources': [
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/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             'src/common/mac',
111           ],
112           'sources': [
113             'src/common/dwarf/dwarf2diehandler.cc',
114             'src/common/dwarf/dwarf2reader.cc',
115             'src/common/dwarf/bytereader.cc',
116             'src/common/dwarf_cfi_to_module.cc',
117             'src/common/dwarf_cu_to_module.cc',
118             'src/common/dwarf_line_to_module.cc',
119             'src/common/language.cc',
120             'src/common/module.cc',
121             'src/common/mac/dump_syms.mm',
122             'src/common/mac/file_id.cc',
123             'src/common/mac/macho_id.cc',
124             'src/common/mac/macho_reader.cc',
125             'src/common/mac/macho_utilities.cc',
126             'src/common/mac/macho_walker.cc',
127             'src/common/stabs_reader.cc',
128             'src/common/stabs_to_module.cc',
129             'src/tools/mac/dump_syms/dump_syms_tool.mm',
130           ],
131           'defines': [
132             # For src/common/stabs_reader.h.
133             'HAVE_MACH_O_NLIST_H',
134           ],
135           'xcode_settings': {
136             # The DWARF utilities require -funsigned-char.
137             'GCC_CHAR_IS_UNSIGNED_CHAR': 'YES',
138             # dwarf2reader.cc uses dynamic_cast.
139             'GCC_ENABLE_CPP_RTTI': 'YES',
140           },
141           'link_settings': {
142             'libraries': [
143               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
144               '$(SDKROOT)/usr/lib/libcrypto.dylib',
145             ],
146           },
147           'configurations': {
148             'Release_Base': {
149               'xcode_settings': {
150                 # dump_syms crashes when built at -O1, -O2, and -O3.  It does
151                 # not crash at -Os.  To play it safe, dump_syms is always built
152                 # at -O0 until this can be sorted out.
153                 # http://code.google.com/p/google-breakpad/issues/detail?id=329
154                 'GCC_OPTIMIZATION_LEVEL': '0',  # -O0
155                },
156              },
157           },
158         },
159         {
160           'target_name': 'symupload',
161           'type': 'executable',
162           'include_dirs': [
163             'src/common/mac',
164           ],
165           'sources': [
166             'src/common/mac/HTTPMultipartUpload.m',
167             'src/tools/mac/symupload/symupload.m',
168           ],
169           'link_settings': {
170             'libraries': [
171               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
172             ],
173           }
174         },
175         {
176           'target_name': 'breakpad',
177           'type': 'static_library',
178           'dependencies': [
179             'breakpad_utilities',
180             'crash_inspector',
181             'crash_report_sender',
182           ],
183           'sources': [
184             'src/client/mac/crash_generation/crash_generation_client.cc',
185             'src/client/mac/crash_generation/crash_generation_client.h',
186             'src/client/mac/handler/protected_memory_allocator.cc',
187             'src/client/mac/handler/exception_handler.cc',
188             'src/client/mac/Framework/Breakpad.mm',
189             'src/client/mac/Framework/OnDemandServer.mm',
190           ],
191         },
192       ],
193     }],
194     [ 'OS=="linux"', {
195       'conditions': [
196         # Tools needed for archiving build symbols.
197         ['linux_breakpad==1', {
198           'targets': [
199             {
200               'target_name': 'symupload',
201               'type': 'executable',
203               # This uses the system libcurl, so don't use the default 32-bit
204               # compile flags when building on a 64-bit machine.
205               'variables': {
206                 'host_arch': '<!(uname -m)',
207               },
208               'conditions': [
209                 ['host_arch=="x86_64"', {
210                   'cflags!': ['-m32', '-march=pentium4', '-msse2',
211                               '-mfpmath=sse'],
212                   'ldflags!': ['-m32'],
213                   'cflags': ['-O2'],
214                   'include_dirs!': ['/usr/include32'],
215                 }],
216               ],
218               'sources': [
219                 'src/tools/linux/symupload/sym_upload.cc',
220                 'src/common/linux/http_upload.cc',
221                 'src/common/linux/http_upload.h',
222               ],
223               'include_dirs': [
224                 'src',
225               ],
226               'link_settings': {
227                 'libraries': [
228                   '-ldl',
229                 ],
230               },
231             },
232             {
233               'target_name': 'dump_syms',
234               'type': 'executable',
236               # dwarf2reader.cc uses dynamic_cast. Because we don't typically
237               # don't support RTTI, we enable it for this single target. Since
238               # dump_syms doesn't share any object files with anything else,
239               # this doesn't end up polluting Chrome itself.
240               'cflags_cc!': ['-fno-rtti'],
242               'sources': [
243                 'src/common/dwarf/bytereader.cc',
244                 'src/common/dwarf_cfi_to_module.cc',
245                 'src/common/dwarf_cfi_to_module.h',
246                 'src/common/dwarf_cu_to_module.cc',
247                 'src/common/dwarf_cu_to_module.h',
248                 'src/common/dwarf/dwarf2diehandler.cc',
249                 'src/common/dwarf/dwarf2reader.cc',
250                 'src/common/dwarf_line_to_module.cc',
251                 'src/common/dwarf_line_to_module.h',
252                 'src/common/language.cc',
253                 'src/common/language.h',
254                 'src/common/linux/dump_symbols.cc',
255                 'src/common/linux/dump_symbols.h',
256                 'src/common/linux/file_id.cc',
257                 'src/common/linux/file_id.h',
258                 'src/common/linux/guid_creator.h',
259                 'src/common/module.cc',
260                 'src/common/module.h',
261                 'src/common/stabs_reader.cc',
262                 'src/common/stabs_reader.h',
263                 'src/common/stabs_to_module.cc',
264                 'src/common/stabs_to_module.h',
265                 'src/tools/linux/dump_syms/dump_syms.cc',
266               ],
268               # Breakpad rev 583 introduced this flag.
269               # Using this define, stabs_reader.h will include a.out.h to
270               # build on Linux.
271               'defines': [
272                 'HAVE_A_OUT_H',
273               ],
275               'include_dirs': [
276                 'src',
277                 '..',
278               ],
279             },
280           ],
281         }],
282       ],
283       'targets': [
284         {
285           'target_name': 'breakpad_client',
286           'type': 'static_library',
288           'sources': [
289             'src/client/linux/crash_generation/crash_generation_client.cc',
290             'src/client/linux/crash_generation/crash_generation_client.h',
291             'src/client/linux/handler/exception_handler.cc',
292             'src/client/linux/minidump_writer/directory_reader.h',
293             'src/client/linux/minidump_writer/line_reader.h',
294             'src/client/linux/minidump_writer/linux_dumper.cc',
295             'src/client/linux/minidump_writer/linux_dumper.h',
296             'src/client/linux/minidump_writer/minidump_writer.cc',
297             'src/client/linux/minidump_writer/minidump_writer.h',
298             'src/client/minidump_file_writer-inl.h',
299             'src/client/minidump_file_writer.cc',
300             'src/client/minidump_file_writer.h',
301             'src/common/convert_UTF.c',
302             'src/common/convert_UTF.h',
303             'src/common/linux/file_id.cc',
304             'src/common/linux/file_id.h',
305             'src/common/linux/google_crashdump_uploader.cc',
306             'src/common/linux/google_crashdump_uploader.h',
307             'src/common/linux/guid_creator.cc',
308             'src/common/linux/guid_creator.h',
309             'src/common/linux/libcurl_wrapper.cc',
310             'src/common/linux/libcurl_wrapper.h',
311             'src/common/linux/linux_libc_support.h',
312             'src/common/memory.h',
313             'src/common/string_conversion.cc',
314             'src/common/string_conversion.h',
315           ],
317           'conditions': [
318             ['target_arch=="arm"', {
319               'cflags': ['-Wa,-mimplicit-it=always'],
320             }],
321           ],
323           'link_settings': {
324             'libraries': [
325               '-ldl',
326             ],
327           },
329           'include_dirs': [
330             'src',
331             'src/client',
332             'src/third_party/linux/include',
333             '..',
334             '.',
335           ],
336         },
337         {
338           # Breakpad r693 uses some files from src/processor in unit tests.
339           'target_name': 'breakpad_processor_support',
340           'type': 'static_library',
342           'sources': [
343             'src/processor/basic_code_modules.cc',
344             'src/processor/basic_code_modules.h',
345             'src/processor/logging.cc',
346             'src/processor/logging.h',
347             'src/processor/minidump.cc',
348             'src/processor/pathname_stripper.cc',
349             'src/processor/pathname_stripper.h',
350           ],
352           'include_dirs': [
353             'src',
354             'src/client',
355             'src/third_party/linux/include',
356             '..',
357             '.',
358           ],
359         },
360         {
361           'target_name': 'breakpad_unittests',
362           'type': 'executable',
363           'dependencies': [
364             '../testing/gtest.gyp:gtest',
365             '../testing/gtest.gyp:gtest_main',
366             '../testing/gmock.gyp:gmock',
367             'breakpad_client',
368             'breakpad_processor_support',
369           ],
371           'sources': [
372             'linux/breakpad_googletest_includes.h',
373             'src/client/linux/handler/exception_handler_unittest.cc',
374             'src/client/linux/minidump_writer/directory_reader_unittest.cc',
375             'src/client/linux/minidump_writer/line_reader_unittest.cc',
376             'src/client/linux/minidump_writer/linux_dumper_unittest.cc',
377             'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
378             'src/common/linux/file_id_unittest.cc',
379             'src/common/linux/linux_libc_support_unittest.cc',
380             'src/common/memory_unittest.cc',
381           ],
383           'include_dirs': [
384             'linux', # Use our copy of breakpad_googletest_includes.h
385             'src',
386             '..',
387             '.',
388           ],
389         },
390         {
391           'target_name': 'generate_test_dump',
392           'type': 'executable',
394           'sources': [
395             'linux/generate-test-dump.cc',
396           ],
398           'dependencies': [
399             'breakpad_client',
400           ],
402           'include_dirs': [
403             '..',
404             'src',
405           ],
406         },
407         {
408           'target_name': 'minidump-2-core',
409           'type': 'executable',
411           'sources': [
412             'src/tools/linux/md2core/minidump-2-core.cc'
413           ],
415           'include_dirs': [
416             '..',
417             'src',
418           ],
419         },
420       ],
421     }],
422   ],