Upstream version 6.35.131.0
[platform/framework/web/crosswalk.git] / src / components / nacl.gyp
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.
4
5 {
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             '../base/base.gyp:base_static',
82             '../ipc/ipc.gyp:ipc',
83             '../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
84             '../ppapi/ppapi_internal.gyp:ppapi_shared',
85             '../ppapi/ppapi_internal.gyp:ppapi_ipc',
86             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome',
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         },
142         {
143           'target_name': 'nacl_renderer',
144           'type': 'static_library',
145           'sources': [
146             'nacl/renderer/nexe_load_manager.cc',
147             'nacl/renderer/nexe_load_manager.h',
148             'nacl/renderer/pnacl_translation_resource_host.cc',
149             'nacl/renderer/pnacl_translation_resource_host.h',
150             'nacl/renderer/ppb_nacl_private_impl.cc',
151             'nacl/renderer/ppb_nacl_private_impl.h',
152             'nacl/renderer/sandbox_arch.cc',
153             'nacl/renderer/sandbox_arch.h',
154             'nacl/renderer/trusted_plugin_channel.cc',
155             'nacl/renderer/trusted_plugin_channel.h',
156           ],
157           'include_dirs': [
158             '..',
159           ],
160           'dependencies': [
161             '../content/content.gyp:content_renderer',
162             '../third_party/WebKit/public/blink.gyp:blink',
163             '../webkit/common/webkit_common.gyp:webkit_common',
164           ],
165           'defines': [
166             '<@(nacl_defines)',
167           ],
168           'direct_dependent_settings': {
169             'defines': [
170               '<@(nacl_defines)',
171             ],
172           },
173         }
174       ],
175       'conditions': [
176         ['OS=="linux"', {
177           'targets': [
178             {
179               'target_name': 'nacl_helper',
180               'type': 'executable',
181               'include_dirs': [
182                 '..',
183               ],
184               'dependencies': [
185                 'nacl',
186                 'nacl_common',
187                 '../components/tracing.gyp:tracing',
188                 '../crypto/crypto.gyp:crypto',
189                 '../sandbox/sandbox.gyp:libc_urandom_override',
190                 '../sandbox/sandbox.gyp:sandbox',
191                 '../ppapi/ppapi_internal.gyp:ppapi_proxy',
192               ],
193               'defines': [
194                 '<@(nacl_defines)',
195                 # Allow .cc files to know if they're being compiled as part
196                 # of nacl_helper.
197                 'IN_NACL_HELPER=1',
198               ],
199               'sources': [
200                 'nacl/loader/nacl_helper_linux.cc',
201                 'nacl/loader/nacl_helper_linux.h',
202                 'nacl/loader/nacl_sandbox_linux.cc',
203                 'nacl/loader/nonsfi/abi_conversion.cc',
204                 'nacl/loader/nonsfi/abi_conversion.h',
205                 'nacl/loader/nonsfi/elf_loader.cc',
206                 'nacl/loader/nonsfi/elf_loader.h',
207                 'nacl/loader/nonsfi/irt_basic.cc',
208                 'nacl/loader/nonsfi/irt_clock.cc',
209                 'nacl/loader/nonsfi/irt_fdio.cc',
210                 'nacl/loader/nonsfi/irt_futex.cc',
211                 'nacl/loader/nonsfi/irt_interfaces.cc',
212                 'nacl/loader/nonsfi/irt_interfaces.h',
213                 'nacl/loader/nonsfi/irt_memory.cc',
214                 'nacl/loader/nonsfi/irt_ppapi.cc',
215                 'nacl/loader/nonsfi/irt_thread.cc',
216                 'nacl/loader/nonsfi/irt_util.h',
217                 'nacl/loader/nonsfi/nonsfi_main.cc',
218                 'nacl/loader/nonsfi/nonsfi_main.h',
219                 '../ppapi/proxy/plugin_main_irt.cc',
220                 '../ppapi/proxy/plugin_main_irt.h',
221               ],
222               'conditions': [
223                 ['toolkit_uses_gtk == 1', {
224                   'dependencies': [
225                     '../build/linux/system.gyp:gtk',
226                   ],
227                 }],
228                 ['use_glib == 1', {
229                   'dependencies': [
230                     '../build/linux/system.gyp:glib',
231                   ],
232                 }],
233                 ['os_posix == 1 and OS != "mac"', {
234                   'conditions': [
235                     # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
236                     ['(use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1)', {
237                       'dependencies': [
238                         '../base/allocator/allocator.gyp:allocator',
239                       ],
240                     }],
241                   ],
242                 }],
243                 ['use_seccomp_bpf == 0', {
244                   'sources!': [
245                     '../content/common/sandbox_linux/sandbox_bpf_base_policy_linux.cc',
246                     '../content/common/sandbox_linux/sandbox_init_linux.cc',
247                   ],
248                 }, {
249                   'defines': ['USE_SECCOMP_BPF'],
250                 }],
251               ],
252               'cflags': ['-fPIE'],
253               'link_settings': {
254                 'ldflags': ['-pie'],
255               },
256             },
257           ],
258         }],
259         ['OS=="win" and target_arch=="ia32"', {
260           'targets': [
261             {
262               'target_name': 'nacl_win64',
263               'type': 'static_library',
264               'variables': {
265                 'nacl_target': 1,
266               },
267               'dependencies': [
268                 'nacl_common_win64',
269                 '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome64',
270                 '../ppapi/ppapi_internal.gyp:ppapi_shared_win64',
271                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
272               ],
273               'export_dependent_settings': [
274                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
275               ],
276               'sources': [
277                 '../components/nacl/broker/nacl_broker_listener.cc',
278                 '../components/nacl/broker/nacl_broker_listener.h',
279                 '../components/nacl/common/nacl_debug_exception_handler_win.cc',
280                 '../components/nacl/loader/nacl_helper_win_64.cc',
281                 '../components/nacl/loader/nacl_helper_win_64.h',
282               ],
283               'include_dirs': [
284                 '..',
285               ],
286               'defines': [
287                 '<@(nacl_win64_defines)',
288                 'COMPILE_CONTENT_STATICALLY',
289               ],
290               'configurations': {
291                 'Common_Base': {
292                   'msvs_target_platform': 'x64',
293                 },
294               },
295               'direct_dependent_settings': {
296                 'defines': [
297                   '<@(nacl_defines)',
298                 ],
299               },
300             },
301             {
302               'target_name': 'nacl_switches_win64',
303               'type': 'static_library',
304               'sources': [
305                 'nacl/common/nacl_switches.cc',
306                 'nacl/common/nacl_switches.h',
307               ],
308               'include_dirs': [
309                 '..',
310               ],
311               'configurations': {
312                 'Common_Base': {
313                   'msvs_target_platform': 'x64',
314                 },
315               },
316             },
317             {
318               'target_name': 'nacl_common_win64',
319               'type': 'static_library',
320               'defines': [
321                 'COMPILE_CONTENT_STATICALLY',
322               ],
323               'sources': [
324                 'nacl/common/nacl_cmd_line.cc',
325                 'nacl/common/nacl_cmd_line.h',
326                 'nacl/common/nacl_messages.cc',
327                 'nacl/common/nacl_messages.h',
328                 'nacl/common/nacl_types.cc',
329                 'nacl/common/nacl_types.h',
330               ],
331               'include_dirs': [
332                 '..',
333               ],
334               'configurations': {
335                 'Common_Base': {
336                   'msvs_target_platform': 'x64',
337                 },
338               },
339             },
340           ],
341         }],
342       ],
343     }, {  # else (disable_nacl==1)
344       'targets': [
345         {
346           'target_name': 'nacl',
347           'type': 'none',
348           'sources': [],
349         },
350       ],
351       'conditions': [
352         ['OS=="win"', {
353           'targets': [
354             {
355               'target_name': 'nacl_win64',
356               'type': 'none',
357               'sources': [],
358             },
359             {
360               'target_name': 'nacl_switches_win64',
361               'type': 'none',
362               'sources': [],
363             },
364           ],
365         }],
366       ],
367     }],
368   ],
369   'targets': [
370     {
371       'target_name': 'nacl_switches',
372       'type': 'static_library',
373       'sources': [
374         'nacl/common/nacl_switches.cc',
375         'nacl/common/nacl_switches.h',
376     ],
377       'include_dirs': [
378         '..',
379       ],
380     },
381     {
382       'target_name': 'nacl_common',
383       'type': 'static_library',
384       'sources': [
385         'nacl/common/nacl_cmd_line.cc',
386         'nacl/common/nacl_cmd_line.h',
387         'nacl/common/nacl_host_messages.h',
388         'nacl/common/nacl_host_messages.cc',
389         'nacl/common/nacl_messages.cc',
390         'nacl/common/nacl_messages.h',
391         'nacl/common/nacl_process_type.h',
392         'nacl/common/nacl_sandbox_type_mac.h',
393         'nacl/common/nacl_types.cc',
394         'nacl/common/nacl_types.h',
395         'nacl/common/pnacl_types.cc',
396         'nacl/common/pnacl_types.h',
397       ],
398       'include_dirs': [
399         '..',
400       ],
401       'dependencies': [
402         '../content/content.gyp:content_common',
403       ],
404     },
405   ]
406 }