Roll src/third_party/WebKit f298044:aa8346d (svn 202628:202629)
[chromium-blink-merge.git] / components / crash.gypi
blob6acfdfc4dd4b22ca08daf8c35e181a7a763afbdb
1 # Copyright 2013 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   'targets': [
7     {
8       # GN version: //components/crash/core/common
9       'target_name': 'crash_core_common',
10       'type': 'static_library',
11       'include_dirs': [
12         '..',
13       ],
14       'dependencies': [
15         # List of dependencies is intentionally very minimal. Please avoid
16         # adding extra dependencies without first checking with OWNERS.
17         '../base/base.gyp:base',
18       ],
19       'sources': [
20         'crash/core/common/crash_keys.cc',
21         'crash/core/common/crash_keys.h',
22       ],
23       'conditions': [
24         ['OS=="mac" or OS=="ios"', {
25           'sources': [
26             'crash/core/common/objc_zombie.h',
27             'crash/core/common/objc_zombie.mm',
28           ],
29         }],
30       ],
31     },
32   ],
33   'conditions': [
34     ['OS=="win" and target_arch=="ia32"', {
35       'targets': [
36         {
37           'target_name': 'crash_core_common_win64',
38           'type': 'static_library',
39           'include_dirs': [
40             '..',
41           ],
42           'dependencies': [
43             # List of dependencies is intentionally very minimal. Please avoid
44             # adding extra dependencies without first checking with OWNERS.
45             '../base/base.gyp:base_win64',
46           ],
47           'sources': [
48             'crash/core/common/crash_keys.cc',
49             'crash/core/common/crash_keys.h',
50           ],
51           'configurations': {
52             'Common_Base': {
53               'msvs_target_platform': 'x64',
54             },
55           },
56         },
57       ],
58     }],
59     ['OS!="ios"', {
60       'targets': [
61         {
62           'target_name': 'crash_component_lib',
63           'type': 'static_library',
64           'sources': [
65             'crash/content/app/crash_keys_win.cc',
66             'crash/content/app/crash_keys_win.h',
67             'crash/content/app/crash_reporter_client.cc',
68             'crash/content/app/crash_reporter_client.h',
69           ],
70           'include_dirs': [
71             '..',
72             '../breakpad/src',
73           ],
74         },
75         {
76           # TODO(mark): https://crbug.com/466890: merge this target with
77           # crash_component.
78           #
79           # This is a temporary base target that is depended on by both
80           # crash_component and crash_component_breakpad_mac_to_be_deleted. It
81           # provides everything common to both of those targets. For a short period,
82           # there are two Mac crash component implementations. The new one uses a
83           # Crashpad implementation and is used by Chrome. The old one uses a
84           # Breakpad implementation and is used by content_shell. Consumers should
85           # depend on the desired target. All three targets behave identically on
86           # non-Mac. When content_shell and any other consumers are migrated to the
87           # Crashpad implementation on Mac, crash_component will merge back into
88           # this target, crash_component_non_mac, which will be renamed
89           # crash_component. crash_component_breakpad_mac_to_be_deleted will be
90           # deleted.
91           #
92           # While this situation exists:
93           #
94           # Do not depend on this target directly! Depend on
95           # crash_component_breakpad_mac_to_be_deleted for old Breakpad behavior on
96           # all platforms, or preferably, depend on crash_component to get Breakpad
97           # everywhere except for Mac, where you will get Crashpad.
98           'target_name': 'crash_component_non_mac',
99           'variables': {
100             'conditions': [
101               ['OS == "ios" or OS == "mac"', {
102                 # On IOS there are no files compiled into the library, and we
103                 # can't have libraries with zero objects.
104                 # For now, the same applies to Mac OS X, until this target merges
105                 # with crash_component.
106                 'crash_component_target_type%': 'none',
107               }, {
108                 'crash_component_target_type%': 'static_library',
109               }],
110             ],
111           },
112           'type': '<(crash_component_target_type)',
113           'sources': [
114             'crash/content/app/breakpad_linux.cc',
115             'crash/content/app/breakpad_linux.h',
116             'crash/content/app/breakpad_linux_impl.h',
117             'crash/content/app/breakpad_win.cc',
118             'crash/content/app/breakpad_win.h',
119             'crash/content/app/hard_error_handler_win.cc',
120             'crash/content/app/hard_error_handler_win.h',
121           ],
122           'dependencies': [
123             'crash_component_lib',
124             '../base/base.gyp:base',
125           ],
126           'defines': ['CRASH_IMPLEMENTATION'],
127           'conditions': [
128             ['OS=="win"', {
129               'dependencies': [
130                 '../breakpad/breakpad.gyp:breakpad_handler',
131                 '../breakpad/breakpad.gyp:breakpad_sender',
132                 '../sandbox/sandbox.gyp:sandbox',
133               ],
134             }],
135             ['os_posix == 1 and OS != "mac" and OS != "ios"', {
136               'dependencies': [
137                 '../breakpad/breakpad.gyp:breakpad_client',
138               ],
139               'include_dirs': [
140                 '../breakpad/src',
141               ],
142             }],
143           ],
144           'target_conditions': [
145             # Need 'target_conditions' to override default filename_rules to include
146             # the files on Android.
147             ['OS=="android"', {
148               'sources/': [
149                 ['include', '^crash/content/app/breakpad_linux\\.cc$'],
150               ],
151             }],
152           ],
153         },
154         {
155           # Note: if you depend on this target, you need to either link in
156           # content.gyp:content_common, or add
157           # content/public/common/content_switches.cc to your sources.
158           #
159           # GN version: //components/crash/content/app
161           # TODO(mark): https://crbug.com/466890: merge this target with
162           # crash_component_non_mac.
163           #
164           # Most of this target is actually in its dependency,
165           # crash_component_non_mac.  See the comment in that target for an
166           # explanation for the split. The split is temporary and the two targets
167           # will be unified again soon.
168           'target_name': 'crash_component',
169           'variables': {
170             'conditions': [
171               ['OS != "mac" ', {
172                 # There are no source files on any platform but Mac OS X.
173                 'crash_component_target_type%': 'none',
174               }, {
175                 'crash_component_target_type%': 'static_library',
176               }],
177             ],
178           },
179           'type': '<(crash_component_target_type)',
180           'sources': [
181             'crash/content/app/crashpad_mac.h',
182             'crash/content/app/crashpad_mac.mm',
183           ],
184           'dependencies': [
185             'crash_component_non_mac',
186             'crash_component_lib',
187             '../base/base.gyp:base',
188           ],
189           'defines': ['CRASH_IMPLEMENTATION'],
190           'conditions': [
191             ['OS=="mac"', {
192               'dependencies': [
193                 '../third_party/crashpad/crashpad/client/client.gyp:crashpad_client',
194               ],
195             }],
196           ],
197         },
198         {
199           # TODO(mark): https://crbug.com/466890: remove this target.
200           #
201           # This is a temporary target provided for Mac Breakpad users that have not
202           # yet migrated to Crashpad (namely content_shell). This target will be
203           # removed shortly and all consumers will be expected to use Crashpad as
204           # the Mac crash-reporting client. See the comment in the
205           # crash_component_non_mac target for more details.
206           'target_name': 'crash_component_breakpad_mac_to_be_deleted',
207           'variables': {
208             'conditions': [
209               ['OS != "mac" ', {
210                 # There are no source files on any platform but Mac OS X.
211                 'crash_component_target_type%': 'none',
212               }, {
213                 'crash_component_target_type%': 'static_library',
214               }],
215             ],
216           },
217           'type': '<(crash_component_target_type)',
218           'sources': [
219             'crash/content/app/breakpad_mac.h',
220             'crash/content/app/breakpad_mac.mm',
221           ],
222           'dependencies': [
223             'crash_component_non_mac',
224             'crash_component_lib',
225           ],
226           'defines': ['CRASH_IMPLEMENTATION'],
227           'conditions': [
228             ['OS=="mac"', {
229               'dependencies': [
230                 '../breakpad/breakpad.gyp:breakpad',
231               ],
232               'include_dirs': [
233                 '..',
234               ],
235             }],
236           ],
237         },
238         {
239           # GN version: //components/crash/content/app:test_support
240           'target_name': 'crash_test_support',
241           'type': 'none',
242           'dependencies': [
243             'crash_component_lib',
244           ],
245           'direct_dependent_settings': {
246             'include_dirs' : [
247               '../breakpad/src',
248             ],
249           }
250         },
251       ],
252       'conditions': [
253         ['OS=="win"', {
254           'targets': [
255             {
256               # GN version: //components/crash/content/tools:crash_service
257               'target_name': 'breakpad_crash_service',
258               'type': 'static_library',
259               'dependencies': [
260                 '../base/base.gyp:base',
261                 '../breakpad/breakpad.gyp:breakpad_handler',
262                 '../breakpad/breakpad.gyp:breakpad_sender',
263               ],
264               'sources': [
265                 'crash/content/tools/crash_service.cc',
266                 'crash/content/tools/crash_service.h',
267               ],
268             },
269           ],
270         }],
271         ['OS=="win" and target_arch=="ia32"', {
272           'targets': [
273             {
274               # Note: if you depend on this target, you need to either link in
275               # content.gyp:content_common, or add
276               # content/public/common/content_switches.cc to your sources.
277               'target_name': 'breakpad_win64',
278               'type': 'static_library',
279               'sources': [
280                 'crash/content/app/breakpad_linux.cc',
281                 'crash/content/app/breakpad_linux.h',
282                 'crash/content/app/breakpad_linux_impl.h',
283                 'crash/content/app/breakpad_mac.h',
284                 'crash/content/app/breakpad_mac.mm',
285                 'crash/content/app/breakpad_win.cc',
286                 'crash/content/app/breakpad_win.h',
287                 # TODO(siggi): test the x64 version too.
288                 'crash/content/app/crash_keys_win.cc',
289                 'crash/content/app/crash_keys_win.h',
290                 'crash/content/app/crash_reporter_client.cc',
291                 'crash/content/app/crash_reporter_client.h',
292                 'crash/content/app/hard_error_handler_win.cc',
293                 'crash/content/app/hard_error_handler_win.h',
294               ],
295               'defines': [
296                 'COMPILE_CONTENT_STATICALLY',
297                 'CRASH_IMPLEMENTATION',
298               ],
299               'dependencies': [
300                 '../base/base.gyp:base_win64',
301                 '../breakpad/breakpad.gyp:breakpad_handler_win64',
302                 '../breakpad/breakpad.gyp:breakpad_sender_win64',
303                 '../sandbox/sandbox.gyp:sandbox_win64',
304               ],
305               'configurations': {
306                 'Common_Base': {
307                   'msvs_target_platform': 'x64',
308                 },
309               },
310             },
311             {
312               'target_name': 'breakpad_crash_service_win64',
313               'type': 'static_library',
314               'dependencies': [
315                 '../base/base.gyp:base_win64',
316                 '../breakpad/breakpad.gyp:breakpad_handler_win64',
317                 '../breakpad/breakpad.gyp:breakpad_sender_win64',
318               ],
319               'sources': [
320                 'crash/content/tools/crash_service.cc',
321                 'crash/content/tools/crash_service.h',
322               ],
323               'configurations': {
324                 'Common_Base': {
325                   'msvs_target_platform': 'x64',
326                 },
327               },
328             },
329           ],
330         }],
331         ['OS=="mac"', {
332           'targets': [
333             {
334               'target_name': 'breakpad_stubs',
335               'type': 'static_library',
336               'dependencies': [
337                 '../base/base.gyp:base',
338               ],
339               'sources': [
340                 'crash/content/app/breakpad_mac.h',
341                 'crash/content/app/breakpad_mac_stubs.mm',
342                 'crash/content/app/crash_reporter_client.cc',
343                 'crash/content/app/crash_reporter_client.h',
344               ],
345             },
346           ],
347         }],
348         ['os_posix == 1 and OS != "mac"', {
349           'targets': [
350             {
351               # GN version: //components/crash/content/browser
352               'target_name': 'breakpad_host',
353               'type': 'static_library',
354               'dependencies': [
355                 'crash_component',
356                 '../base/base.gyp:base',
357                 '../breakpad/breakpad.gyp:breakpad_client',
358                 '../content/content.gyp:content_browser',
359                 '../content/content.gyp:content_common',
360               ],
361               'sources': [
362                 'crash/content/browser/crash_dump_manager_android.cc',
363                 'crash/content/browser/crash_dump_manager_android.h',
364                 'crash/content/browser/crash_handler_host_linux.cc',
365                 'crash/content/browser/crash_handler_host_linux.h',
366               ],
367               'include_dirs': [
368                 '../breakpad/src',
369               ],
370               'target_conditions': [
371                 # Need 'target_conditions' to override default filename_rules to include
372                 # the files on Android.
373                 ['OS=="android"', {
374                   'sources/': [
375                     ['include', '^crash/content/browser/crash_handler_host_linux\\.cc$'],
376                   ],
377                 }],
378               ],
379             },
380           ],
381         }],
382       ],
383     }],
384   ],