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