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