Remove RenderWidget's asynchronous swap support.
[chromium-blink-merge.git] / components / nacl.gyp
blob8415280830fe53a92eb0f88ece4c7c5cb92ce7c3
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/manifest_service_channel.cc',
157             'nacl/renderer/manifest_service_channel.h',
158             'nacl/renderer/nexe_load_manager.cc',
159             'nacl/renderer/nexe_load_manager.h',
160             'nacl/renderer/pnacl_translation_resource_host.cc',
161             'nacl/renderer/pnacl_translation_resource_host.h',
162             'nacl/renderer/ppb_nacl_private_impl.cc',
163             'nacl/renderer/ppb_nacl_private_impl.h',
164             'nacl/renderer/sandbox_arch.cc',
165             'nacl/renderer/sandbox_arch.h',
166             'nacl/renderer/trusted_plugin_channel.cc',
167             'nacl/renderer/trusted_plugin_channel.h',
168           ],
169           'include_dirs': [
170             '..',
171           ],
172           'dependencies': [
173             '../content/content.gyp:content_renderer',
174             '../third_party/WebKit/public/blink.gyp:blink',
175             '../webkit/common/webkit_common.gyp:webkit_common',
176           ],
177           'defines': [
178             '<@(nacl_defines)',
179           ],
180           'direct_dependent_settings': {
181             'defines': [
182               '<@(nacl_defines)',
183             ],
184           },
185         }
186       ],
187       'conditions': [
188         ['OS=="linux"', {
189           'targets': [
190             {
191               'target_name': 'nacl_helper',
192               'type': 'executable',
193               'include_dirs': [
194                 '..',
195               ],
196               'sources': [
197                 'nacl/loader/nacl_helper_linux.cc',
198                 'nacl/loader/nacl_helper_linux.h',
199               ],
200               'dependencies': [
201                 'nacl_loader',
202               ],
203               'cflags': ['-fPIE'],
204               'ldflags!': [
205                 # Do not pick the default ASan options from
206                 # base/debug/sanitizer_options.cc to avoid a conflict with those
207                 # in nacl/nacl_helper_linux.cc.
208                 '-Wl,-u_sanitizer_options_link_helper',
209               ],
210               'link_settings': {
211                 'ldflags': ['-pie'],
212               },
213             }, {
214               'target_name': 'nacl_loader',
215               'type': 'static_library',
216               'include_dirs': [
217                 '..',
218               ],
219               'defines': [
220                 '<@(nacl_defines)',
221                 # Allow .cc files to know if they're being compiled as part
222                 # of nacl_helper.
223                 'IN_NACL_HELPER=1',
224               ],
225               'sources': [
226                 'nacl/loader/nacl_sandbox_linux.cc',
227                 'nacl/loader/nonsfi/abi_conversion.cc',
228                 'nacl/loader/nonsfi/abi_conversion.h',
229                 'nacl/loader/nonsfi/elf_loader.cc',
230                 'nacl/loader/nonsfi/elf_loader.h',
231                 'nacl/loader/nonsfi/irt_basic.cc',
232                 'nacl/loader/nonsfi/irt_clock.cc',
233                 'nacl/loader/nonsfi/irt_fdio.cc',
234                 'nacl/loader/nonsfi/irt_futex.cc',
235                 'nacl/loader/nonsfi/irt_interfaces.cc',
236                 'nacl/loader/nonsfi/irt_interfaces.h',
237                 'nacl/loader/nonsfi/irt_memory.cc',
238                 'nacl/loader/nonsfi/irt_ppapi.cc',
239                 'nacl/loader/nonsfi/irt_random.cc',
240                 'nacl/loader/nonsfi/irt_thread.cc',
241                 'nacl/loader/nonsfi/irt_util.h',
242                 'nacl/loader/nonsfi/nonsfi_main.cc',
243                 'nacl/loader/nonsfi/nonsfi_main.h',
244                 'nacl/loader/nonsfi/nonsfi_sandbox.cc',
245                 'nacl/loader/nonsfi/nonsfi_sandbox.h',
246                 '../ppapi/nacl_irt/manifest_service.cc',
247                 '../ppapi/nacl_irt/manifest_service.h',
248                 '../ppapi/nacl_irt/plugin_main.cc',
249                 '../ppapi/nacl_irt/plugin_main.h',
250                 '../ppapi/nacl_irt/plugin_startup.cc',
251                 '../ppapi/nacl_irt/plugin_startup.h',
252                 '../ppapi/nacl_irt/ppapi_dispatcher.cc',
253                 '../ppapi/nacl_irt/ppapi_dispatcher.h',
254               ],
255               'dependencies': [
256                 'nacl',
257                 'nacl_common',
258                 'nacl_switches',
259                 '../components/tracing.gyp:tracing',
260                 '../crypto/crypto.gyp:crypto',
261                 '../sandbox/sandbox.gyp:libc_urandom_override',
262                 '../sandbox/sandbox.gyp:sandbox',
263                 '../ppapi/ppapi_internal.gyp:ppapi_proxy',
264               ],
265               'conditions': [
266                 ['use_glib == 1', {
267                   'dependencies': [
268                     '../build/linux/system.gyp:glib',
269                   ],
270                 }],
271                 ['os_posix == 1 and OS != "mac"', {
272                   'conditions': [
273                     # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
274                     ['(use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1)', {
275                       'dependencies': [
276                         '../base/allocator/allocator.gyp:allocator',
277                       ],
278                     }],
279                   ],
280                 }],
281                 ['use_seccomp_bpf == 0', {
282                   'sources!': [
283                     '../content/common/sandbox_linux/sandbox_bpf_base_policy_linux.cc',
284                     '../content/common/sandbox_linux/sandbox_init_linux.cc',
285                   ],
286                 }, {
287                   'defines': ['USE_SECCOMP_BPF'],
288                 }],
289               ],
290               'cflags': ['-fPIE'],
291             }, {
292               'target_name': 'nacl_loader_unittests',
293               'type': '<(gtest_target_type)',
294               'sources': [
295                 # TODO(hamaji): Currently, we build them twice. Stop building
296                 # them for components_unittests. See crbug.com/364751
297                 'nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc',
298                 'nacl/loader/nonsfi/nonsfi_sandbox_sigsys_unittest.cc',
299                 'nacl/loader/run_all_unittests.cc',
300               ],
301               'dependencies': [
302                 'nacl_loader',
303                 '../base/base.gyp:test_support_base',
304                 '../sandbox/sandbox.gyp:sandbox_linux_test_utils',
305                 '../testing/gtest.gyp:gtest',
306               ],
307             },
308           ],
309         }],
310         ['OS=="win" and target_arch=="ia32"', {
311           'targets': [
312             {
313               'target_name': 'nacl_win64',
314               'type': 'static_library',
315               'variables': {
316                 'nacl_target': 1,
317               },
318               'dependencies': [
319                 'nacl_common_win64',
320                 '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome64',
321                 '../ppapi/ppapi_internal.gyp:ppapi_shared_win64',
322                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
323               ],
324               'export_dependent_settings': [
325                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
326               ],
327               'sources': [
328                 '../components/nacl/broker/nacl_broker_listener.cc',
329                 '../components/nacl/broker/nacl_broker_listener.h',
330                 '../components/nacl/common/nacl_debug_exception_handler_win.cc',
331                 '../components/nacl/loader/nacl_helper_win_64.cc',
332                 '../components/nacl/loader/nacl_helper_win_64.h',
333               ],
334               'include_dirs': [
335                 '..',
336               ],
337               'defines': [
338                 '<@(nacl_win64_defines)',
339                 'COMPILE_CONTENT_STATICALLY',
340               ],
341               'configurations': {
342                 'Common_Base': {
343                   'msvs_target_platform': 'x64',
344                 },
345               },
346               'direct_dependent_settings': {
347                 'defines': [
348                   '<@(nacl_defines)',
349                 ],
350               },
351             },
352             {
353               'target_name': 'nacl_switches_win64',
354               'type': 'static_library',
355               'sources': [
356                 'nacl/common/nacl_switches.cc',
357                 'nacl/common/nacl_switches.h',
358               ],
359               'include_dirs': [
360                 '..',
361               ],
362               'configurations': {
363                 'Common_Base': {
364                   'msvs_target_platform': 'x64',
365                 },
366               },
367             },
368             {
369               'target_name': 'nacl_common_win64',
370               'type': 'static_library',
371               'defines': [
372                 'COMPILE_CONTENT_STATICALLY',
373               ],
374               'sources': [
375                 'nacl/common/nacl_cmd_line.cc',
376                 'nacl/common/nacl_cmd_line.h',
377                 'nacl/common/nacl_messages.cc',
378                 'nacl/common/nacl_messages.h',
379                 'nacl/common/nacl_types.cc',
380                 'nacl/common/nacl_types.h',
381               ],
382               'include_dirs': [
383                 '..',
384               ],
385               'configurations': {
386                 'Common_Base': {
387                   'msvs_target_platform': 'x64',
388                 },
389               },
390             },
391           ],
392         }],
393       ],
394     }, {  # else (disable_nacl==1)
395       'targets': [
396         {
397           'target_name': 'nacl',
398           'type': 'none',
399           'sources': [],
400         },
401       ],
402       'conditions': [
403         ['OS=="win"', {
404           'targets': [
405             {
406               'target_name': 'nacl_win64',
407               'type': 'none',
408               'sources': [],
409             },
410             {
411               'target_name': 'nacl_switches_win64',
412               'type': 'none',
413               'sources': [],
414             },
415           ],
416         }],
417       ],
418     }],
419   ],
420   'targets': [
421     {
422       'target_name': 'nacl_switches',
423       'type': 'static_library',
424       'sources': [
425         'nacl/common/nacl_switches.cc',
426         'nacl/common/nacl_switches.h',
427     ],
428       'include_dirs': [
429         '..',
430       ],
431     },
432     {
433       'target_name': 'nacl_common',
434       'type': 'static_library',
435       'sources': [
436         'nacl/common/nacl_cmd_line.cc',
437         'nacl/common/nacl_cmd_line.h',
438         'nacl/common/nacl_host_messages.h',
439         'nacl/common/nacl_host_messages.cc',
440         'nacl/common/nacl_messages.cc',
441         'nacl/common/nacl_messages.h',
442         'nacl/common/nacl_process_type.h',
443         'nacl/common/nacl_sandbox_type_mac.h',
444         'nacl/common/nacl_types.cc',
445         'nacl/common/nacl_types.h',
446         'nacl/common/pnacl_types.cc',
447         'nacl/common/pnacl_types.h',
448       ],
449       'include_dirs': [
450         '..',
451       ],
452       'dependencies': [
453         '../content/content.gyp:content_common',
454       ],
455     },
456   ]