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