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