Replace command buffer FlushSync with WaitForTokenInRange and WaitForGetOffsetInRange
[chromium-blink-merge.git] / components / nacl.gyp
blob9cf8d9276a12a9f05d5e3ffe598a30719c53f964
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               '../components/nacl/zygote/nacl_fork_delegate_linux.cc',
63               '../components/nacl/zygote/nacl_fork_delegate_linux.h',
64             ],
65           },],
66         ],
67       }],
68     ],
69   },
70   'conditions': [
71     ['disable_nacl!=1', {
72       'targets': [
73         {
74           'target_name': 'nacl',
75           'type': 'static_library',
76           'variables': {
77             'nacl_target': 1,
78           },
79           'dependencies': [
80             '../base/base.gyp:base',
81             '../ipc/ipc.gyp:ipc',
82             '../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
83             '../ppapi/ppapi_internal.gyp:ppapi_shared',
84             '../ppapi/ppapi_internal.gyp:ppapi_ipc',
85             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome',
86           ],
87           'conditions': [
88             ['disable_nacl_untrusted==0', {
89               'dependencies': [
90                 '../ppapi/native_client/native_client.gyp:nacl_irt',
91                 '../ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp:pnacl_support_extension',
92               ],
93             }],
94           ],
95           'direct_dependent_settings': {
96             'defines': [
97               '<@(nacl_defines)',
98             ],
99           },
100         },
101         {
102           'target_name': 'nacl_browser',
103           'type': 'static_library',
104           'sources': [
105             'nacl/browser/nacl_broker_host_win.cc',
106             'nacl/browser/nacl_broker_host_win.h',
107             'nacl/browser/nacl_broker_service_win.cc',
108             'nacl/browser/nacl_broker_service_win.h',
109             'nacl/browser/nacl_browser.cc',
110             'nacl/browser/nacl_browser.h',
111             'nacl/browser/nacl_file_host.cc',
112             'nacl/browser/nacl_file_host.h',
113             'nacl/browser/nacl_host_message_filter.cc',
114             'nacl/browser/nacl_host_message_filter.h',
115             'nacl/browser/nacl_process_host.cc',
116             'nacl/browser/nacl_process_host.h',
117             'nacl/browser/nacl_validation_cache.cc',
118             'nacl/browser/nacl_validation_cache.h',
119             'nacl/browser/pnacl_host.cc',
120             'nacl/browser/pnacl_host.h',
121             'nacl/browser/pnacl_translation_cache.cc',
122             'nacl/browser/pnacl_translation_cache.h',
123             'nacl/common/nacl_debug_exception_handler_win.cc',
124             'nacl/common/nacl_debug_exception_handler_win.h',
125           ],
126           'include_dirs': [
127             '..',
128           ],
129           'dependencies': [
130             'nacl_common',
131             'nacl_switches',
132             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel',
133             '../content/content.gyp:content_browser',
134           ],
135           'defines': [
136             '<@(nacl_defines)',
137           ],
138           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
139           'msvs_disabled_warnings': [4267, ],
140         },
141         {
142           'target_name': 'nacl_renderer',
143           'type': 'static_library',
144           'sources': [
145             'nacl/renderer/pnacl_translation_resource_host.cc',
146             'nacl/renderer/pnacl_translation_resource_host.h',
147             'nacl/renderer/ppb_nacl_private_impl.cc',
148             'nacl/renderer/ppb_nacl_private_impl.h',
149             'nacl/renderer/sandbox_arch.cc',
150             'nacl/renderer/sandbox_arch.h',
151             'nacl/renderer/trusted_plugin_channel.cc',
152             'nacl/renderer/trusted_plugin_channel.h',
153           ],
154           'include_dirs': [
155             '..',
156           ],
157           'dependencies': [
158             '../content/content.gyp:content_renderer',
159             '../third_party/WebKit/public/blink.gyp:blink',
160             '../webkit/common/webkit_common.gyp:webkit_common',
161           ],
162           'defines': [
163             '<@(nacl_defines)',
164           ],
165           'direct_dependent_settings': {
166             'defines': [
167               '<@(nacl_defines)',
168             ],
169           },
170         }
171       ],
172       'conditions': [
173         ['OS=="linux"', {
174           'targets': [
175             {
176               'target_name': 'nacl_helper',
177               'type': 'executable',
178               'include_dirs': [
179                 '..',
180               ],
181               'dependencies': [
182                 'nacl',
183                 'nacl_common',
184                 '../components/tracing.gyp:tracing',
185                 '../crypto/crypto.gyp:crypto',
186                 '../sandbox/sandbox.gyp:libc_urandom_override',
187                 '../sandbox/sandbox.gyp:sandbox',
188                 '../ppapi/ppapi_internal.gyp:ppapi_proxy',
189               ],
190               'defines': [
191                 '<@(nacl_defines)',
192                 # Allow .cc files to know if they're being compiled as part
193                 # of nacl_helper.
194                 'IN_NACL_HELPER=1',
195               ],
196               'sources': [
197                 'nacl/loader/nacl_helper_linux.cc',
198                 'nacl/loader/nacl_helper_linux.h',
199                 'nacl/loader/nacl_sandbox_linux.cc',
200                 'nacl/loader/nonsfi/abi_conversion.cc',
201                 'nacl/loader/nonsfi/abi_conversion.h',
202                 'nacl/loader/nonsfi/elf_loader.cc',
203                 'nacl/loader/nonsfi/elf_loader.h',
204                 'nacl/loader/nonsfi/irt_basic.cc',
205                 'nacl/loader/nonsfi/irt_clock.cc',
206                 'nacl/loader/nonsfi/irt_fdio.cc',
207                 'nacl/loader/nonsfi/irt_futex.cc',
208                 'nacl/loader/nonsfi/irt_interfaces.cc',
209                 'nacl/loader/nonsfi/irt_interfaces.h',
210                 'nacl/loader/nonsfi/irt_memory.cc',
211                 'nacl/loader/nonsfi/irt_ppapi.cc',
212                 'nacl/loader/nonsfi/irt_thread.cc',
213                 'nacl/loader/nonsfi/irt_util.h',
214                 'nacl/loader/nonsfi/nonsfi_main.cc',
215                 'nacl/loader/nonsfi/nonsfi_main.h',
216                 '../ppapi/proxy/plugin_main_irt.cc',
217                 '../ppapi/proxy/plugin_main_irt.h',
218               ],
219               'conditions': [
220                 ['toolkit_uses_gtk == 1', {
221                   'dependencies': [
222                     '../build/linux/system.gyp:gtk',
223                   ],
224                 }],
225                 ['use_glib == 1', {
226                   'dependencies': [
227                     '../build/linux/system.gyp:glib',
228                   ],
229                 }],
230                 ['os_posix == 1 and OS != "mac"', {
231                   'conditions': [
232                     # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
233                     ['(use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1)', {
234                       'dependencies': [
235                         '../base/allocator/allocator.gyp:allocator',
236                       ],
237                     }],
238                   ],
239                 }],
240                 ['use_seccomp_bpf == 0', {
241                   'sources!': [
242                     '../content/common/sandbox_linux/sandbox_bpf_base_policy_linux.cc',
243                     '../content/common/sandbox_linux/sandbox_init_linux.cc',
244                   ],
245                 }, {
246                   'defines': ['USE_SECCOMP_BPF'],
247                 }],
248               ],
249               'cflags': ['-fPIE'],
250               'link_settings': {
251                 'ldflags': ['-pie'],
252               },
253             },
254           ],
255         }],
256         ['OS=="win" and target_arch=="ia32"', {
257           'targets': [
258             {
259               'target_name': 'nacl_win64',
260               'type': 'static_library',
261               'variables': {
262                 'nacl_target': 1,
263               },
264               'dependencies': [
265                 'nacl_common_win64',
266                 '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome64',
267                 '../ppapi/ppapi_internal.gyp:ppapi_shared_win64',
268                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
269               ],
270               'export_dependent_settings': [
271                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
272               ],
273               'sources': [
274                 '../components/nacl/broker/nacl_broker_listener.cc',
275                 '../components/nacl/broker/nacl_broker_listener.h',
276                 '../components/nacl/common/nacl_debug_exception_handler_win.cc',
277                 '../components/nacl/loader/nacl_helper_win_64.cc',
278                 '../components/nacl/loader/nacl_helper_win_64.h',
279               ],
280               'include_dirs': [
281                 '..',
282               ],
283               'defines': [
284                 '<@(nacl_win64_defines)',
285                 'COMPILE_CONTENT_STATICALLY',
286               ],
287               'configurations': {
288                 'Common_Base': {
289                   'msvs_target_platform': 'x64',
290                 },
291               },
292               'direct_dependent_settings': {
293                 'defines': [
294                   '<@(nacl_defines)',
295                 ],
296               },
297             },
298             {
299               'target_name': 'nacl_switches_win64',
300               'type': 'static_library',
301               'sources': [
302                 'nacl/common/nacl_switches.cc',
303                 'nacl/common/nacl_switches.h',
304               ],
305               'include_dirs': [
306                 '..',
307               ],
308               'configurations': {
309                 'Common_Base': {
310                   'msvs_target_platform': 'x64',
311                 },
312               },
313             },
314             {
315               'target_name': 'nacl_common_win64',
316               'type': 'static_library',
317               'defines': [
318                 'COMPILE_CONTENT_STATICALLY',
319               ],
320               'sources': [
321                 'nacl/common/nacl_cmd_line.cc',
322                 'nacl/common/nacl_cmd_line.h',
323                 'nacl/common/nacl_messages.cc',
324                 'nacl/common/nacl_messages.h',
325                 'nacl/common/nacl_types.cc',
326                 'nacl/common/nacl_types.h',
327               ],
328               'include_dirs': [
329                 '..',
330               ],
331               'configurations': {
332                 'Common_Base': {
333                   'msvs_target_platform': 'x64',
334                 },
335               },
336             },
337           ],
338         }],
339       ],
340     }, {  # else (disable_nacl==1)
341       'targets': [
342         {
343           'target_name': 'nacl',
344           'type': 'none',
345           'sources': [],
346         },
347       ],
348       'conditions': [
349         ['OS=="win"', {
350           'targets': [
351             {
352               'target_name': 'nacl_win64',
353               'type': 'none',
354               'sources': [],
355             },
356             {
357               'target_name': 'nacl_switches_win64',
358               'type': 'none',
359               'sources': [],
360             },
361           ],
362         }],
363       ],
364     }],
365   ],
366   'targets': [
367     {
368       'target_name': 'nacl_switches',
369       'type': 'static_library',
370       'sources': [
371         'nacl/common/nacl_switches.cc',
372         'nacl/common/nacl_switches.h',
373     ],
374       'include_dirs': [
375         '..',
376       ],
377     },
378     {
379       'target_name': 'nacl_common',
380       'type': 'static_library',
381       'sources': [
382         'nacl/common/nacl_cmd_line.cc',
383         'nacl/common/nacl_cmd_line.h',
384         'nacl/common/nacl_host_messages.h',
385         'nacl/common/nacl_host_messages.cc',
386         'nacl/common/nacl_messages.cc',
387         'nacl/common/nacl_messages.h',
388         'nacl/common/nacl_process_type.h',
389         'nacl/common/nacl_sandbox_type_mac.h',
390         'nacl/common/nacl_types.cc',
391         'nacl/common/nacl_types.h',
392         'nacl/common/pnacl_types.cc',
393         'nacl/common/pnacl_types.h',
394       ],
395       'include_dirs': [
396         '..',
397       ],
398       'dependencies': [
399         '../content/content.gyp:content_common',
400       ],
401     },
402   ]