summaryrefslogtreecommitdiffstats
path: root/components/crash.gypi
blob: 6ba24028c34755aa0909466740a97b41f3db1af6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
  'targets': [
    {
      'target_name': 'crash_component_lib',
      'type': 'static_library',
      'sources': [
        'crash/app/crash_keys_win.cc',
        'crash/app/crash_keys_win.h',
        'crash/app/crash_reporter_client.cc',
        'crash/app/crash_reporter_client.h',
      ],
      'include_dirs': [
        '..',
        '../breakpad/src',
      ],
    },
    {
      # TODO(mark): https://crbug.com/466890: merge this target with
      # crash_component.
      #
      # This is a temporary base target that is depended on by both
      # crash_component and crash_component_breakpad_mac_to_be_deleted. It
      # provides everything common to both of those targets. For a short period,
      # there are two Mac crash component implementations. The new one uses a
      # Crashpad implementation and is used by Chrome. The old one uses a
      # Breakpad implementation and is used by content_shell. Consumers should
      # depend on the desired target. All three targets behave identically on
      # non-Mac. When content_shell and any other consumers are migrated to the
      # Crashpad implementation on Mac, crash_component will merge back into
      # this target, crash_component_non_mac, which will be renamed
      # crash_component. crash_component_breakpad_mac_to_be_deleted will be
      # deleted.
      #
      # While this situation exists:
      #
      # Do not depend on this target directly! Depend on
      # crash_component_breakpad_mac_to_be_deleted for old Breakpad behavior on
      # all platforms, or preferably, depend on crash_component to get Breakpad
      # everywhere except for Mac, where you will get Crashpad.
      'target_name': 'crash_component_non_mac',
      'variables': {
        'conditions': [
          ['OS == "ios" or OS == "mac"', {
            # On IOS there are no files compiled into the library, and we
            # can't have libraries with zero objects.
            # For now, the same applies to Mac OS X, until this target merges
            # with crash_component.
            'crash_component_target_type%': 'none',
          }, {
            'crash_component_target_type%': 'static_library',
          }],
        ],
      },
      'type': '<(crash_component_target_type)',
      'sources': [
        'crash/app/breakpad_linux.cc',
        'crash/app/breakpad_linux.h',
        'crash/app/breakpad_linux_impl.h',
        'crash/app/breakpad_win.cc',
        'crash/app/breakpad_win.h',
        'crash/app/hard_error_handler_win.cc',
        'crash/app/hard_error_handler_win.h',
      ],
      'dependencies': [
        'crash_component_lib',
        '../base/base.gyp:base',
      ],
      'defines': ['CRASH_IMPLEMENTATION'],
      'conditions': [
        ['OS=="win"', {
          'dependencies': [
            '../breakpad/breakpad.gyp:breakpad_handler',
            '../breakpad/breakpad.gyp:breakpad_sender',
            '../sandbox/sandbox.gyp:sandbox',
          ],
        }],
        ['os_posix == 1 and OS != "mac" and OS != "ios"', {
          'dependencies': [
            '../breakpad/breakpad.gyp:breakpad_client',
          ],
          'include_dirs': [
            '../breakpad/src',
          ],
        }],
      ],
      'target_conditions': [
        # Need 'target_conditions' to override default filename_rules to include
        # the files on Android.
        ['OS=="android"', {
          'sources/': [
            ['include', '^crash/app/breakpad_linux\\.cc$'],
          ],
        }],
      ],
    },
    {
      # Note: if you depend on this target, you need to either link in
      # content.gyp:content_common, or add
      # content/public/common/content_switches.cc to your sources.
      #
      # GN version: //components/crash/app

      # TODO(mark): https://crbug.com/466890: merge this target with
      # crash_component_non_mac.
      #
      # Most of this target is actually in its dependency,
      # crash_component_non_mac.  See the comment in that target for an
      # explanation for the split. The split is temporary and the two targets
      # will be unified again soon.
      'target_name': 'crash_component',
      'variables': {
        'conditions': [
          ['OS != "mac" ', {
            # There are no source files on any platform but Mac OS X.
            'crash_component_target_type%': 'none',
          }, {
            'crash_component_target_type%': 'static_library',
          }],
        ],
      },
      'type': '<(crash_component_target_type)',
      'sources': [
        'crash/app/crashpad_mac.h',
        'crash/app/crashpad_mac.mm',
      ],
      'dependencies': [
        'crash_component_non_mac',
        'crash_component_lib',
        '../base/base.gyp:base',
      ],
      'defines': ['CRASH_IMPLEMENTATION'],
      'conditions': [
        ['OS=="mac"', {
          'dependencies': [
            '../third_party/crashpad/crashpad/client/client.gyp:crashpad_client',
          ],
        }],
      ],
    },
    {
      # TODO(mark): https://crbug.com/466890: remove this target.
      #
      # This is a temporary target provided for Mac Breakpad users that have not
      # yet migrated to Crashpad (namely content_shell). This target will be
      # removed shortly and all consumers will be expected to use Crashpad as
      # the Mac crash-reporting client. See the comment in the
      # crash_component_non_mac target for more details.
      'target_name': 'crash_component_breakpad_mac_to_be_deleted',
      'variables': {
        'conditions': [
          ['OS != "mac" ', {
            # There are no source files on any platform but Mac OS X.
            'crash_component_target_type%': 'none',
          }, {
            'crash_component_target_type%': 'static_library',
          }],
        ],
      },
      'type': '<(crash_component_target_type)',
      'sources': [
        'crash/app/breakpad_mac.h',
        'crash/app/breakpad_mac.mm',
      ],
      'dependencies': [
        'crash_component_non_mac',
        'crash_component_lib',
      ],
      'defines': ['CRASH_IMPLEMENTATION'],
      'conditions': [
        ['OS=="mac"', {
          'dependencies': [
            '../breakpad/breakpad.gyp:breakpad',
          ],
          'include_dirs': [
            '..',
          ],
        }],
      ],
    },
    {
      # GN version: //components/crash/app:test_support
      'target_name': 'crash_test_support',
      'type': 'none',
      'dependencies': [
        'crash_component_lib',
      ],
      'direct_dependent_settings': {
        'include_dirs' : [
          '../breakpad/src',
        ],
      }
    },
  ],
  'conditions': [
    ['OS=="win"', {
      'targets': [
        {
          # GN version: //components/crash/tools:crash_service
          'target_name': 'breakpad_crash_service',
          'type': 'static_library',
          'dependencies': [
            '../base/base.gyp:base',
            '../breakpad/breakpad.gyp:breakpad_handler',
            '../breakpad/breakpad.gyp:breakpad_sender',
          ],
          'sources': [
            'crash/tools/crash_service.cc',
            'crash/tools/crash_service.h',
          ],
        },
      ],
    }],
    ['OS=="win" and target_arch=="ia32"', {
      'targets': [
        {
          # Note: if you depend on this target, you need to either link in
          # content.gyp:content_common, or add
          # content/public/common/content_switches.cc to your sources.
          'target_name': 'breakpad_win64',
          'type': 'static_library',
          'sources': [
            'crash/app/breakpad_linux.cc',
            'crash/app/breakpad_linux.h',
            'crash/app/breakpad_linux_impl.h',
            'crash/app/breakpad_mac.h',
            'crash/app/breakpad_mac.mm',
            'crash/app/breakpad_win.cc',
            'crash/app/breakpad_win.h',
            # TODO(siggi): test the x64 version too.
            'crash/app/crash_keys_win.cc',
            'crash/app/crash_keys_win.h',
            'crash/app/crash_reporter_client.cc',
            'crash/app/crash_reporter_client.h',
            'crash/app/hard_error_handler_win.cc',
            'crash/app/hard_error_handler_win.h',
          ],
          'defines': [
            'COMPILE_CONTENT_STATICALLY',
            'CRASH_IMPLEMENTATION',
          ],
          'dependencies': [
            '../base/base.gyp:base_win64',
            '../breakpad/breakpad.gyp:breakpad_handler_win64',
            '../breakpad/breakpad.gyp:breakpad_sender_win64',
            '../sandbox/sandbox.gyp:sandbox_win64',
          ],
          'configurations': {
            'Common_Base': {
              'msvs_target_platform': 'x64',
            },
          },
        },
        {
          'target_name': 'breakpad_crash_service_win64',
          'type': 'static_library',
          'dependencies': [
            '../base/base.gyp:base_win64',
            '../breakpad/breakpad.gyp:breakpad_handler_win64',
            '../breakpad/breakpad.gyp:breakpad_sender_win64',
          ],
          'sources': [
            'crash/tools/crash_service.cc',
            'crash/tools/crash_service.h',
          ],
          'configurations': {
            'Common_Base': {
              'msvs_target_platform': 'x64',
            },
          },
        },
      ],
    }],
    ['OS=="mac"', {
      'targets': [
        {
          'target_name': 'breakpad_stubs',
          'type': 'static_library',
          'dependencies': [
            '../base/base.gyp:base',
          ],
          'sources': [
            'crash/app/breakpad_mac.h',
            'crash/app/breakpad_mac_stubs.mm',
            'crash/app/crash_reporter_client.cc',
            'crash/app/crash_reporter_client.h',
          ],
        },
      ],
    }],
    ['os_posix == 1 and OS != "mac" and OS != "ios"', {
      'targets': [
        {
          # GN version: //components/crash/browser
          'target_name': 'breakpad_host',
          'type': 'static_library',
          'dependencies': [
            'crash_component',
            '../base/base.gyp:base',
            '../breakpad/breakpad.gyp:breakpad_client',
            '../content/content.gyp:content_browser',
            '../content/content.gyp:content_common',
          ],
          'sources': [
            'crash/browser/crash_dump_manager_android.cc',
            'crash/browser/crash_dump_manager_android.h',
            'crash/browser/crash_handler_host_linux.cc',
            'crash/browser/crash_handler_host_linux.h',
          ],
          'include_dirs': [
            '../breakpad/src',
          ],
          'target_conditions': [
            # Need 'target_conditions' to override default filename_rules to include
            # the files on Android.
            ['OS=="android"', {
              'sources/': [
                ['include', '^crash/browser/crash_handler_host_linux\\.cc$'],
              ],
            }],
          ],
        },
      ],
    }],
  ],
}