NaCl: Update revision in DEPS, 2363d1a -> 66f4b73
[chromium-blink-merge.git] / components / nacl.gyp
blob8524e92ee9c1d9d084957abff74aaa7081813f02
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             '../crypto/crypto.gyp:crypto',
81             '../ipc/ipc.gyp:ipc',
82             '../mojo/mojo_nacl.gyp:monacl_syscall',
83             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome',
84             '../ppapi/ppapi_internal.gyp:ppapi_ipc',
85             '../ppapi/ppapi_internal.gyp:ppapi_shared',
86             '../third_party/mojo/mojo_edk.gyp:mojo_system_impl',
87           ],
88           'conditions': [
89             ['disable_nacl_untrusted==0', {
90               'dependencies': [
91                 '../ppapi/native_client/native_client.gyp:nacl_irt',
92                 '../ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp:pnacl_support_extension',
93               ],
94             }],
95           ],
96           'direct_dependent_settings': {
97             'defines': [
98               '<@(nacl_defines)',
99             ],
100           },
101         },
102         {
103           'target_name': 'nacl_browser',
104           'type': 'static_library',
105           'sources': [
106             'nacl/browser/nacl_broker_host_win.cc',
107             'nacl/browser/nacl_broker_host_win.h',
108             'nacl/browser/nacl_broker_service_win.cc',
109             'nacl/browser/nacl_broker_service_win.h',
110             'nacl/browser/nacl_browser.cc',
111             'nacl/browser/nacl_browser.h',
112             'nacl/browser/nacl_file_host.cc',
113             'nacl/browser/nacl_file_host.h',
114             'nacl/browser/nacl_host_message_filter.cc',
115             'nacl/browser/nacl_host_message_filter.h',
116             'nacl/browser/nacl_process_host.cc',
117             'nacl/browser/nacl_process_host.h',
118             'nacl/browser/nacl_validation_cache.cc',
119             'nacl/browser/nacl_validation_cache.h',
120             'nacl/browser/pnacl_host.cc',
121             'nacl/browser/pnacl_host.h',
122             'nacl/browser/pnacl_translation_cache.cc',
123             'nacl/browser/pnacl_translation_cache.h',
124             'nacl/common/nacl_debug_exception_handler_win.cc',
125             'nacl/common/nacl_debug_exception_handler_win.h',
126           ],
127           'include_dirs': [
128             '..',
129           ],
130           'dependencies': [
131             'nacl_common',
132             'nacl_switches',
133             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel',
134             '../content/content.gyp:content_browser',
135           ],
136           'defines': [
137             '<@(nacl_defines)',
138           ],
139           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
140           'msvs_disabled_warnings': [4267, ],
141           'conditions': [
142             ['OS=="linux"', {
143               'sources': [
144                 '../components/nacl/zygote/nacl_fork_delegate_linux.cc',
145                 '../components/nacl/zygote/nacl_fork_delegate_linux.h',
146               ],
147               'dependencies': [
148                 # Required by nacl_fork_delegate_linux.cc.
149                 '../sandbox/sandbox.gyp:suid_sandbox_client',
150                 '../sandbox/sandbox.gyp:sandbox_services',
151               ]
152             }],
153           ],
154         },
155         {
156           'target_name': 'nacl_renderer',
157           'type': 'static_library',
158           'sources': [
159             'nacl/renderer/file_downloader.cc',
160             'nacl/renderer/file_downloader.h',
161             'nacl/renderer/histogram.cc',
162             'nacl/renderer/histogram.h',
163             'nacl/renderer/manifest_downloader.cc',
164             'nacl/renderer/manifest_downloader.h',
165             'nacl/renderer/manifest_service_channel.cc',
166             'nacl/renderer/manifest_service_channel.h',
167             'nacl/renderer/nacl_helper.cc',
168             'nacl/renderer/nacl_helper.h',
169             'nacl/renderer/json_manifest.cc',
170             'nacl/renderer/json_manifest.h',
171             'nacl/renderer/nexe_load_manager.cc',
172             'nacl/renderer/nexe_load_manager.h',
173             'nacl/renderer/platform_info.cc',
174             'nacl/renderer/platform_info.h',
175             'nacl/renderer/pnacl_translation_resource_host.cc',
176             'nacl/renderer/pnacl_translation_resource_host.h',
177             'nacl/renderer/ppb_nacl_private_impl.cc',
178             'nacl/renderer/ppb_nacl_private_impl.h',
179             'nacl/renderer/progress_event.cc',
180             'nacl/renderer/progress_event.h',
181             'nacl/renderer/trusted_plugin_channel.cc',
182             'nacl/renderer/trusted_plugin_channel.h',
183           ],
184           'include_dirs': [
185             '..',
186           ],
187           'dependencies': [
188             'nacl_common',
189             '../content/content.gyp:content_renderer',
190             '../components/nacl/renderer/plugin/plugin.gyp:nacl_trusted_plugin',
191             '../third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
192             '../third_party/WebKit/public/blink.gyp:blink',
193           ],
194           'defines': [
195             '<@(nacl_defines)',
196           ],
197           'direct_dependent_settings': {
198             'defines': [
199               '<@(nacl_defines)',
200             ],
201           },
202         },
203         {
204           'target_name': 'nacl_loader_unittests',
205           'type': '<(gtest_target_type)',
206           'sources': [
207             'nacl/loader/nacl_ipc_adapter_unittest.cc',
208             'nacl/loader/nacl_validation_query_unittest.cc',
209             'nacl/loader/run_all_unittests.cc',
210           ],
211           'dependencies': [
212             'nacl',
213             '../base/base.gyp:test_support_base',
214             '../ipc/ipc.gyp:test_support_ipc',
215             '../testing/gtest.gyp:gtest',
216           ],
217           'conditions': [
218             ['OS=="linux"', {
219               'sources': [
220                 # TODO(mazda): Move this to browser_tests once we have
221                 # established a way to run browser_tests on ARM Chrome OS
222                 # devices (http://crbug.com/364729).
223                 'nacl/loader/nonsfi/irt_icache_unittest.cc',
224                 # TODO(hamaji): Currently, we build them twice. Stop building
225                 # them for components_unittests. See crbug.com/364751
226                 'nacl/loader/nonsfi/nonsfi_sandbox_sigsys_unittest.cc',
227                 'nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc',
228               ],
229               'dependencies': [
230                 'nacl_linux',
231                 '../sandbox/sandbox.gyp:sandbox_linux_test_utils',
232               ],
233             }],
234           ],
235         },
236       ],
237       'conditions': [
238         ['OS=="linux"', {
239           'targets': [
240             {
241               'target_name': 'nacl_helper',
242               'type': 'executable',
243               'include_dirs': [
244                 '..',
245               ],
246               'sources': [
247                 'nacl/loader/nacl_helper_linux.cc',
248                 'nacl/loader/nacl_helper_linux.h',
249               ],
250               'dependencies': [
251                 'nacl_linux',
252               ],
253               'cflags': ['-fPIE'],
254               'ldflags!': [
255                 # Do not pick the default ASan options from
256                 # build/sanitizers/sanitizer_options.cc to avoid a conflict with
257                 # those in nacl/nacl_helper_linux.cc.
258                 '-Wl,-u_sanitizer_options_link_helper',
259               ],
260               'link_settings': {
261                 'ldflags': ['-pie'],
262               },
263             }, {
264               'target_name': 'nacl_linux',
265               'type': 'static_library',
266               'include_dirs': [
267                 '..',
268               ],
269               'defines': [
270                 '<@(nacl_defines)',
271                 # Allow .cc files to know if they're being compiled as part
272                 # of nacl_helper.
273                 'IN_NACL_HELPER=1',
274               ],
275               'sources': [
276                 'nacl/loader/nonsfi/abi_conversion.cc',
277                 'nacl/loader/nonsfi/abi_conversion.h',
278                 'nacl/loader/nonsfi/elf_loader.cc',
279                 'nacl/loader/nonsfi/elf_loader.h',
280                 'nacl/loader/nonsfi/irt_basic.cc',
281                 'nacl/loader/nonsfi/irt_clock.cc',
282                 'nacl/loader/nonsfi/irt_exception_handling.cc',
283                 'nacl/loader/nonsfi/irt_fdio.cc',
284                 'nacl/loader/nonsfi/irt_futex.cc',
285                 'nacl/loader/nonsfi/irt_icache.cc',
286                 'nacl/loader/nonsfi/irt_interfaces.cc',
287                 'nacl/loader/nonsfi/irt_interfaces.h',
288                 'nacl/loader/nonsfi/irt_memory.cc',
289                 'nacl/loader/nonsfi/irt_ppapi.cc',
290                 'nacl/loader/nonsfi/irt_random.cc',
291                 'nacl/loader/nonsfi/irt_resource_open.cc',
292                 'nacl/loader/nonsfi/irt_thread.cc',
293                 'nacl/loader/nonsfi/irt_util.h',
294                 'nacl/loader/nonsfi/nonsfi_listener.cc',
295                 'nacl/loader/nonsfi/nonsfi_listener.h',
296                 'nacl/loader/nonsfi/nonsfi_main.cc',
297                 'nacl/loader/nonsfi/nonsfi_main.h',
298                 'nacl/loader/nonsfi/nonsfi_sandbox.cc',
299                 'nacl/loader/nonsfi/nonsfi_sandbox.h',
300                 'nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc',
301                 'nacl/loader/sandbox_linux/nacl_sandbox_linux.cc',
302                 '../ppapi/nacl_irt/irt_manifest.h',
303                 '../ppapi/nacl_irt/manifest_service.cc',
304                 '../ppapi/nacl_irt/manifest_service.h',
305                 '../ppapi/nacl_irt/plugin_main.cc',
306                 '../ppapi/nacl_irt/plugin_main.h',
307                 '../ppapi/nacl_irt/plugin_startup.cc',
308                 '../ppapi/nacl_irt/plugin_startup.h',
309                 '../ppapi/nacl_irt/ppapi_dispatcher.cc',
310                 '../ppapi/nacl_irt/ppapi_dispatcher.h',
311               ],
312               'dependencies': [
313                 'nacl',
314                 'nacl_common',
315                 'nacl_switches',
316                 '../components/tracing.gyp:tracing',
317                 '../crypto/crypto.gyp:crypto',
318                 '../sandbox/sandbox.gyp:libc_urandom_override',
319                 '../sandbox/sandbox.gyp:sandbox',
320                 '../ppapi/ppapi_internal.gyp:ppapi_proxy',
321               ],
322               'conditions': [
323                 ['use_glib == 1', {
324                   'dependencies': [
325                     '../build/linux/system.gyp:glib',
326                   ],
327                 }],
328                 ['os_posix == 1 and OS != "mac"', {
329                   'conditions': [
330                     ['use_allocator!="none"', {
331                       'dependencies': [
332                         '../base/allocator/allocator.gyp:allocator',
333                       ],
334                     }],
335                   ],
336                 }],
337                 ['use_seccomp_bpf == 0', {
338                   'sources!': [
339                     '../content/common/sandbox_linux/sandbox_bpf_base_policy_linux.cc',
340                     '../content/common/sandbox_linux/sandbox_init_linux.cc',
341                   ],
342                 }, {
343                   'defines': ['USE_SECCOMP_BPF'],
344                 }],
345               ],
346               'cflags': ['-fPIE'],
347             },
348           ],
349         }],
350         ['OS=="win" and target_arch=="ia32"', {
351           'targets': [
352             {
353               'target_name': 'nacl_win64',
354               'type': 'static_library',
355               'variables': {
356                 'nacl_target': 1,
357               },
358               'dependencies': [
359                 'nacl_common_win64',
360                 '../mojo/mojo_nacl.gyp:monacl_syscall_win64',
361                 '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome64',
362                 '../ppapi/ppapi_internal.gyp:ppapi_shared_win64',
363                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
364                 '../third_party/mojo/mojo_edk.gyp:mojo_system_impl_win64',
365               ],
366               'export_dependent_settings': [
367                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
368               ],
369               'sources': [
370                 '../components/nacl/broker/nacl_broker_listener.cc',
371                 '../components/nacl/broker/nacl_broker_listener.h',
372                 '../components/nacl/common/nacl_debug_exception_handler_win.cc',
373                 '../components/nacl/loader/nacl_helper_win_64.cc',
374                 '../components/nacl/loader/nacl_helper_win_64.h',
375               ],
376               'include_dirs': [
377                 '..',
378               ],
379               'defines': [
380                 '<@(nacl_win64_defines)',
381                 'COMPILE_CONTENT_STATICALLY',
382               ],
383               'configurations': {
384                 'Common_Base': {
385                   'msvs_target_platform': 'x64',
386                 },
387               },
388               'direct_dependent_settings': {
389                 'defines': [
390                   '<@(nacl_defines)',
391                 ],
392               },
393             },
394             {
395               'target_name': 'nacl_switches_win64',
396               'type': 'static_library',
397               'sources': [
398                 'nacl/common/nacl_switches.cc',
399                 'nacl/common/nacl_switches.h',
400               ],
401               'include_dirs': [
402                 '..',
403               ],
404               'configurations': {
405                 'Common_Base': {
406                   'msvs_target_platform': 'x64',
407                 },
408               },
409             },
410             {
411               'target_name': 'nacl_common_win64',
412               'type': 'static_library',
413               'defines': [
414                 'COMPILE_CONTENT_STATICALLY',
415               ],
416               'sources': [
417                 'nacl/common/nacl_cmd_line.cc',
418                 'nacl/common/nacl_cmd_line.h',
419                 'nacl/common/nacl_constants.cc',
420                 'nacl/common/nacl_constants.h',
421                 'nacl/common/nacl_messages.cc',
422                 'nacl/common/nacl_messages.h',
423                 'nacl/common/nacl_renderer_messages.h',
424                 'nacl/common/nacl_renderer_messages.cc',
425                 'nacl/common/nacl_types.cc',
426                 'nacl/common/nacl_types.h',
427                 'nacl/common/nacl_types_param_traits.cc',
428                 'nacl/common/nacl_types_param_traits.h',
429               ],
430               'include_dirs': [
431                 '..',
432               ],
433               'configurations': {
434                 'Common_Base': {
435                   'msvs_target_platform': 'x64',
436                 },
437               },
438             },
439           ],
440         }],
441       ],
442     }, {  # else (disable_nacl==1)
443       'targets': [
444         {
445           'target_name': 'nacl',
446           'type': 'none',
447           'sources': [],
448         },
449       ],
450       'conditions': [
451         ['OS=="win"', {
452           'targets': [
453             {
454               'target_name': 'nacl_win64',
455               'type': 'none',
456               'sources': [],
457             },
458             {
459               'target_name': 'nacl_switches_win64',
460               'type': 'none',
461               'sources': [],
462             },
463           ],
464         }],
465       ],
466     }],
467     ['disable_nacl!=1 and test_isolation_mode!="noop"', {
468       'targets': [
469         {
470           'target_name': 'nacl_loader_unittests_run',
471           'type': 'none',
472           'dependencies': [
473             'nacl_loader_unittests',
474           ],
475           'includes': [
476             '../build/isolate.gypi',
477           ],
478           'sources': [
479             'nacl_loader_unittests.isolate',
480           ],
481         },
482       ],
483     }],
484   ],
485   'targets': [
486     {
487       'target_name': 'nacl_switches',
488       'type': 'static_library',
489       'sources': [
490         'nacl/common/nacl_switches.cc',
491         'nacl/common/nacl_switches.h',
492     ],
493       'include_dirs': [
494         '..',
495       ],
496     },
497     {
498       'target_name': 'nacl_common',
499       'type': 'static_library',
500       'sources': [
501         'nacl/common/nacl_cmd_line.cc',
502         'nacl/common/nacl_cmd_line.h',
503         'nacl/common/nacl_constants.cc',
504         'nacl/common/nacl_constants.h',
505         'nacl/common/nacl_host_messages.h',
506         'nacl/common/nacl_host_messages.cc',
507         'nacl/common/nacl_messages.cc',
508         'nacl/common/nacl_messages.h',
509         'nacl/common/nacl_nonsfi_util.cc',
510         'nacl/common/nacl_nonsfi_util.h',
511         'nacl/common/nacl_process_type.h',
512         'nacl/common/nacl_renderer_messages.h',
513         'nacl/common/nacl_renderer_messages.cc',
514         'nacl/common/nacl_sandbox_type_mac.h',
515         'nacl/common/nacl_types.cc',
516         'nacl/common/nacl_types.h',
517         'nacl/common/nacl_types_param_traits.cc',
518         'nacl/common/nacl_types_param_traits.h',
519         'nacl/common/pnacl_types.cc',
520         'nacl/common/pnacl_types.h',
521       ],
522       'include_dirs': [
523         '..',
524       ],
525       'dependencies': [
526         '../content/content.gyp:content_common',
527       ],
528     },
529   ]