Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / components / nacl.gyp
blob23d886eb4b53be79f82aeba4335357ab2018868a
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   'variables': {
7     'chromium_code': 1,
8   },
9   'includes': [
10     'nacl/nacl_defines.gypi',
11   ],
12   'target_defaults': {
13     'variables': {
14       'nacl_target': 0,
15     },
16     'target_conditions': [
17       # This part is shared between the targets defined below. Only files and
18       # settings relevant for building the Win64 target should be added here.
19       ['nacl_target==1', {
20         'include_dirs': [
21           '<(INTERMEDIATE_DIR)',
22         ],
23         'defines': [
24           '<@(nacl_defines)',
25         ],
26         'sources': [
27           # .cc, .h, and .mm files under nacl that are used on all
28           # platforms, including both 32-bit and 64-bit Windows.
29           # Test files are also not included.
30           'nacl/loader/nacl_ipc_adapter.cc',
31           'nacl/loader/nacl_ipc_adapter.h',
32           'nacl/loader/nacl_main.cc',
33           'nacl/loader/nacl_main_platform_delegate.h',
34           'nacl/loader/nacl_main_platform_delegate_linux.cc',
35           'nacl/loader/nacl_main_platform_delegate_mac.mm',
36           'nacl/loader/nacl_main_platform_delegate_win.cc',
37           'nacl/loader/nacl_listener.cc',
38           'nacl/loader/nacl_listener.h',
39           'nacl/loader/nacl_trusted_listener.cc',
40           'nacl/loader/nacl_trusted_listener.h',
41           'nacl/loader/nacl_validation_db.h',
42           'nacl/loader/nacl_validation_query.cc',
43           'nacl/loader/nacl_validation_query.h',
44         ],
45         # TODO(gregoryd): consider switching NaCl to use Chrome OS defines
46         'conditions': [
47           ['OS=="win"', {
48             'defines': [
49               '__STDC_LIMIT_MACROS=1',
50             ],
51             'include_dirs': [
52               '<(DEPTH)/third_party/wtl/include',
53             ],
54           },],
55           ['OS=="linux"', {
56             'defines': [
57               '__STDC_LIMIT_MACROS=1',
58             ],
59             'sources': [
60               '../components/nacl/common/nacl_paths.cc',
61               '../components/nacl/common/nacl_paths.h',
62             ],
63           },],
64         ],
65       }],
66     ],
67   },
68   'conditions': [
69     ['disable_nacl!=1', {
70       'targets': [
71         {
72           'target_name': 'nacl',
73           'type': 'static_library',
74           'variables': {
75             'nacl_target': 1,
76           },
77           'dependencies': [
78             '../base/base.gyp:base',
79             '../base/base.gyp:base_static',
80             '../ipc/ipc.gyp:ipc',
81             '../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
82             '../ppapi/ppapi_internal.gyp:ppapi_shared',
83             '../ppapi/ppapi_internal.gyp:ppapi_ipc',
84             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome',
85           ],
86           'conditions': [
87             ['disable_nacl_untrusted==0', {
88               'dependencies': [
89                 '../ppapi/native_client/native_client.gyp:nacl_irt',
90                 '../ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp:pnacl_support_extension',
91               ],
92             }],
93           ],
94           'direct_dependent_settings': {
95             'defines': [
96               '<@(nacl_defines)',
97             ],
98           },
99         },
100         {
101           'target_name': 'nacl_browser',
102           'type': 'static_library',
103           'sources': [
104             'nacl/browser/nacl_broker_host_win.cc',
105             'nacl/browser/nacl_broker_host_win.h',
106             'nacl/browser/nacl_broker_service_win.cc',
107             'nacl/browser/nacl_broker_service_win.h',
108             'nacl/browser/nacl_browser.cc',
109             'nacl/browser/nacl_browser.h',
110             'nacl/browser/nacl_file_host.cc',
111             'nacl/browser/nacl_file_host.h',
112             'nacl/browser/nacl_host_message_filter.cc',
113             'nacl/browser/nacl_host_message_filter.h',
114             'nacl/browser/nacl_process_host.cc',
115             'nacl/browser/nacl_process_host.h',
116             'nacl/browser/nacl_validation_cache.cc',
117             'nacl/browser/nacl_validation_cache.h',
118             'nacl/browser/pnacl_host.cc',
119             'nacl/browser/pnacl_host.h',
120             'nacl/browser/pnacl_translation_cache.cc',
121             'nacl/browser/pnacl_translation_cache.h',
122             'nacl/common/nacl_debug_exception_handler_win.cc',
123             'nacl/common/nacl_debug_exception_handler_win.h',
124           ],
125           'include_dirs': [
126             '..',
127           ],
128           'dependencies': [
129             'nacl_common',
130             'nacl_switches',
131             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel',
132             '../content/content.gyp:content_browser',
133           ],
134           'defines': [
135             '<@(nacl_defines)',
136           ],
137           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
138           'msvs_disabled_warnings': [4267, ],
139           'conditions': [
140             ['OS=="linux"', {
141               'sources': [
142                 '../components/nacl/zygote/nacl_fork_delegate_linux.cc',
143                 '../components/nacl/zygote/nacl_fork_delegate_linux.h',
144               ],
145               'dependencies': [
146                 # Required by nacl_fork_delegate_linux.cc.
147                 '../sandbox/sandbox.gyp:suid_sandbox_client',
148               ]
149             }],
150           ],
151         },
152         {
153           'target_name': 'nacl_renderer',
154           'type': 'static_library',
155           'sources': [
156             'nacl/renderer/histogram.cc',
157             'nacl/renderer/histogram.h',
158             'nacl/renderer/manifest_downloader.cc',
159             'nacl/renderer/manifest_downloader.h',
160             'nacl/renderer/manifest_service_channel.cc',
161             'nacl/renderer/manifest_service_channel.h',
162             'nacl/renderer/nexe_load_manager.cc',
163             'nacl/renderer/nexe_load_manager.h',
164             'nacl/renderer/pnacl_translation_resource_host.cc',
165             'nacl/renderer/pnacl_translation_resource_host.h',
166             'nacl/renderer/ppb_nacl_private_impl.cc',
167             'nacl/renderer/ppb_nacl_private_impl.h',
168             'nacl/renderer/sandbox_arch.cc',
169             'nacl/renderer/sandbox_arch.h',
170             'nacl/renderer/trusted_plugin_channel.cc',
171             'nacl/renderer/trusted_plugin_channel.h',
172           ],
173           'include_dirs': [
174             '..',
175           ],
176           'dependencies': [
177             '../content/content.gyp:content_renderer',
178             '../third_party/WebKit/public/blink.gyp:blink',
179             '../webkit/common/webkit_common.gyp:webkit_common',
180           ],
181           'defines': [
182             '<@(nacl_defines)',
183           ],
184           'direct_dependent_settings': {
185             'defines': [
186               '<@(nacl_defines)',
187             ],
188           },
189         },
190         {
191           'target_name': 'nacl_loader_unittests',
192           'type': '<(gtest_target_type)',
193           'sources': [
194             'nacl/loader/run_all_unittests.cc',
195           ],
196           'dependencies': [
197             'nacl',
198             '../base/base.gyp:test_support_base',
199             '../testing/gtest.gyp:gtest',
200           ],
201           'conditions': [
202             ['OS=="linux"', {
203               'sources': [
204                 # TODO(hamaji): Currently, we build them twice. Stop building
205                 # them for components_unittests. See crbug.com/364751
206                 'nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc',
207                 'nacl/loader/nonsfi/nonsfi_sandbox_sigsys_unittest.cc',
208               ],
209               'dependencies': [
210                 'nacl_linux',
211                 '../sandbox/sandbox.gyp:sandbox_linux_test_utils',
212               ],
213             }],
214           ],
215         },
216       ],
217       'conditions': [
218         ['OS=="linux"', {
219           'targets': [
220             {
221               'target_name': 'nacl_helper',
222               'type': 'executable',
223               'include_dirs': [
224                 '..',
225               ],
226               'sources': [
227                 'nacl/loader/nacl_helper_linux.cc',
228                 'nacl/loader/nacl_helper_linux.h',
229               ],
230               'dependencies': [
231                 'nacl_linux',
232               ],
233               'cflags': ['-fPIE'],
234               'ldflags!': [
235                 # Do not pick the default ASan options from
236                 # base/debug/sanitizer_options.cc to avoid a conflict with those
237                 # in nacl/nacl_helper_linux.cc.
238                 '-Wl,-u_sanitizer_options_link_helper',
239               ],
240               'link_settings': {
241                 'ldflags': ['-pie'],
242               },
243             }, {
244               'target_name': 'nacl_linux',
245               'type': 'static_library',
246               'include_dirs': [
247                 '..',
248               ],
249               'defines': [
250                 '<@(nacl_defines)',
251                 # Allow .cc files to know if they're being compiled as part
252                 # of nacl_helper.
253                 'IN_NACL_HELPER=1',
254               ],
255               'sources': [
256                 'nacl/loader/nonsfi/abi_conversion.cc',
257                 'nacl/loader/nonsfi/abi_conversion.h',
258                 'nacl/loader/nonsfi/elf_loader.cc',
259                 'nacl/loader/nonsfi/elf_loader.h',
260                 'nacl/loader/nonsfi/irt_basic.cc',
261                 'nacl/loader/nonsfi/irt_clock.cc',
262                 'nacl/loader/nonsfi/irt_exception_handling.cc',
263                 'nacl/loader/nonsfi/irt_fdio.cc',
264                 'nacl/loader/nonsfi/irt_futex.cc',
265                 'nacl/loader/nonsfi/irt_interfaces.cc',
266                 'nacl/loader/nonsfi/irt_interfaces.h',
267                 'nacl/loader/nonsfi/irt_memory.cc',
268                 'nacl/loader/nonsfi/irt_ppapi.cc',
269                 'nacl/loader/nonsfi/irt_random.cc',
270                 'nacl/loader/nonsfi/irt_resource_open.cc',
271                 'nacl/loader/nonsfi/irt_thread.cc',
272                 'nacl/loader/nonsfi/irt_util.h',
273                 'nacl/loader/nonsfi/nonsfi_main.cc',
274                 'nacl/loader/nonsfi/nonsfi_main.h',
275                 'nacl/loader/nonsfi/nonsfi_sandbox.cc',
276                 'nacl/loader/nonsfi/nonsfi_sandbox.h',
277                 'nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc',
278                 'nacl/loader/sandbox_linux/nacl_sandbox_linux.cc',
279                 '../ppapi/nacl_irt/irt_manifest.h',
280                 '../ppapi/nacl_irt/manifest_service.cc',
281                 '../ppapi/nacl_irt/manifest_service.h',
282                 '../ppapi/nacl_irt/plugin_main.cc',
283                 '../ppapi/nacl_irt/plugin_main.h',
284                 '../ppapi/nacl_irt/plugin_startup.cc',
285                 '../ppapi/nacl_irt/plugin_startup.h',
286                 '../ppapi/nacl_irt/ppapi_dispatcher.cc',
287                 '../ppapi/nacl_irt/ppapi_dispatcher.h',
288               ],
289               'dependencies': [
290                 'nacl',
291                 'nacl_common',
292                 'nacl_switches',
293                 '../components/tracing.gyp:tracing',
294                 '../crypto/crypto.gyp:crypto',
295                 '../sandbox/sandbox.gyp:libc_urandom_override',
296                 '../sandbox/sandbox.gyp:sandbox',
297                 '../ppapi/ppapi_internal.gyp:ppapi_proxy',
298               ],
299               'conditions': [
300                 ['use_glib == 1', {
301                   'dependencies': [
302                     '../build/linux/system.gyp:glib',
303                   ],
304                 }],
305                 ['os_posix == 1 and OS != "mac"', {
306                   'conditions': [
307                     # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
308                     ['(use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1)', {
309                       'dependencies': [
310                         '../base/allocator/allocator.gyp:allocator',
311                       ],
312                     }],
313                   ],
314                 }],
315                 ['use_seccomp_bpf == 0', {
316                   'sources!': [
317                     '../content/common/sandbox_linux/sandbox_bpf_base_policy_linux.cc',
318                     '../content/common/sandbox_linux/sandbox_init_linux.cc',
319                   ],
320                 }, {
321                   'defines': ['USE_SECCOMP_BPF'],
322                 }],
323               ],
324               'cflags': ['-fPIE'],
325             },
326           ],
327         }],
328         ['OS=="win" and target_arch=="ia32"', {
329           'targets': [
330             {
331               'target_name': 'nacl_win64',
332               'type': 'static_library',
333               'variables': {
334                 'nacl_target': 1,
335               },
336               'dependencies': [
337                 'nacl_common_win64',
338                 '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome64',
339                 '../ppapi/ppapi_internal.gyp:ppapi_shared_win64',
340                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
341               ],
342               'export_dependent_settings': [
343                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
344               ],
345               'sources': [
346                 '../components/nacl/broker/nacl_broker_listener.cc',
347                 '../components/nacl/broker/nacl_broker_listener.h',
348                 '../components/nacl/common/nacl_debug_exception_handler_win.cc',
349                 '../components/nacl/loader/nacl_helper_win_64.cc',
350                 '../components/nacl/loader/nacl_helper_win_64.h',
351               ],
352               'include_dirs': [
353                 '..',
354               ],
355               'defines': [
356                 '<@(nacl_win64_defines)',
357                 'COMPILE_CONTENT_STATICALLY',
358               ],
359               'configurations': {
360                 'Common_Base': {
361                   'msvs_target_platform': 'x64',
362                 },
363               },
364               'direct_dependent_settings': {
365                 'defines': [
366                   '<@(nacl_defines)',
367                 ],
368               },
369             },
370             {
371               'target_name': 'nacl_switches_win64',
372               'type': 'static_library',
373               'sources': [
374                 'nacl/common/nacl_switches.cc',
375                 'nacl/common/nacl_switches.h',
376               ],
377               'include_dirs': [
378                 '..',
379               ],
380               'configurations': {
381                 'Common_Base': {
382                   'msvs_target_platform': 'x64',
383                 },
384               },
385             },
386             {
387               'target_name': 'nacl_common_win64',
388               'type': 'static_library',
389               'defines': [
390                 'COMPILE_CONTENT_STATICALLY',
391               ],
392               'sources': [
393                 'nacl/common/nacl_cmd_line.cc',
394                 'nacl/common/nacl_cmd_line.h',
395                 'nacl/common/nacl_messages.cc',
396                 'nacl/common/nacl_messages.h',
397                 'nacl/common/nacl_types.cc',
398                 'nacl/common/nacl_types.h',
399               ],
400               'include_dirs': [
401                 '..',
402               ],
403               'configurations': {
404                 'Common_Base': {
405                   'msvs_target_platform': 'x64',
406                 },
407               },
408             },
409           ],
410         }],
411       ],
412     }, {  # else (disable_nacl==1)
413       'targets': [
414         {
415           'target_name': 'nacl',
416           'type': 'none',
417           'sources': [],
418         },
419       ],
420       'conditions': [
421         ['OS=="win"', {
422           'targets': [
423             {
424               'target_name': 'nacl_win64',
425               'type': 'none',
426               'sources': [],
427             },
428             {
429               'target_name': 'nacl_switches_win64',
430               'type': 'none',
431               'sources': [],
432             },
433           ],
434         }],
435       ],
436     }],
437   ],
438   'targets': [
439     {
440       'target_name': 'nacl_switches',
441       'type': 'static_library',
442       'sources': [
443         'nacl/common/nacl_switches.cc',
444         'nacl/common/nacl_switches.h',
445     ],
446       'include_dirs': [
447         '..',
448       ],
449     },
450     {
451       'target_name': 'nacl_common',
452       'type': 'static_library',
453       'sources': [
454         'nacl/common/nacl_cmd_line.cc',
455         'nacl/common/nacl_cmd_line.h',
456         'nacl/common/nacl_host_messages.h',
457         'nacl/common/nacl_host_messages.cc',
458         'nacl/common/nacl_messages.cc',
459         'nacl/common/nacl_messages.h',
460         'nacl/common/nacl_process_type.h',
461         'nacl/common/nacl_sandbox_type_mac.h',
462         'nacl/common/nacl_types.cc',
463         'nacl/common/nacl_types.h',
464         'nacl/common/pnacl_types.cc',
465         'nacl/common/pnacl_types.h',
466       ],
467       'include_dirs': [
468         '..',
469       ],
470       'dependencies': [
471         '../content/content.gyp:content_common',
472       ],
473     },
474   ]