[Android] Add ps_ext tool for tools-friendly cpu/mem/proc stats.
[chromium-blink-merge.git] / components / nacl.gyp
blob2721ebb2b68561df3ac159d5d84d885f4a3e8116
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_validation_db.h',
40           'nacl/loader/nacl_validation_query.cc',
41           'nacl/loader/nacl_validation_query.h',
42         ],
43         # TODO(gregoryd): consider switching NaCl to use Chrome OS defines
44         'conditions': [
45           ['OS=="win"', {
46             'defines': [
47               '__STDC_LIMIT_MACROS=1',
48             ],
49             'include_dirs': [
50               '<(DEPTH)/third_party/wtl/include',
51             ],
52           },],
53           ['OS=="linux"', {
54             'defines': [
55               '__STDC_LIMIT_MACROS=1',
56             ],
57             'sources': [
58               '../components/nacl/common/nacl_paths.cc',
59               '../components/nacl/common/nacl_paths.h',
60               '../components/nacl/zygote/nacl_fork_delegate_linux.cc',
61               '../components/nacl/zygote/nacl_fork_delegate_linux.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             '../ipc/ipc.gyp:ipc',
80             '../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
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_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
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         },
140         {
141           'target_name': 'nacl_renderer',
142           'type': 'static_library',
143           'sources': [
144             'nacl/renderer/pnacl_translation_resource_host.cc',
145             'nacl/renderer/pnacl_translation_resource_host.h',
146             'nacl/renderer/ppb_nacl_private_impl.cc',
147             'nacl/renderer/ppb_nacl_private_impl.h',
148           ],
149           'include_dirs': [
150             '..',
151           ],
152           'dependencies': [
153             '../content/content.gyp:content_renderer',
154             '../third_party/WebKit/public/blink.gyp:blink',
155             '../webkit/common/webkit_common.gyp:webkit_common',
156           ],
157           'defines': [
158             '<@(nacl_defines)',
159           ],
160           'direct_dependent_settings': {
161             'defines': [
162               '<@(nacl_defines)',
163             ],
164           },
165         }
166       ],
167       'conditions': [
168         ['OS=="linux"', {
169           'targets': [
170             {
171               'target_name': 'nacl_helper',
172               'type': 'executable',
173               'include_dirs': [
174                 '..',
175               ],
176               'dependencies': [
177                 'nacl',
178                 'nacl_common',
179                 '../crypto/crypto.gyp:crypto',
180                 '../sandbox/sandbox.gyp:libc_urandom_override',
181                 '../sandbox/sandbox.gyp:sandbox',
182               ],
183               'defines': [
184                 '<@(nacl_defines)',
185                 # Allow .cc files to know if they're being compiled as part
186                 # of nacl_helper.
187                 'IN_NACL_HELPER=1',
188               ],
189               'sources': [
190                 'nacl/loader/nacl_helper_linux.cc',
191                 'nacl/loader/nacl_helper_linux.h',
192                 'nacl/loader/nacl_sandbox_linux.cc',
193                 'nacl/loader/nonsfi/abi_conversion.cc',
194                 'nacl/loader/nonsfi/abi_conversion.h',
195                 'nacl/loader/nonsfi/elf_loader.cc',
196                 'nacl/loader/nonsfi/elf_loader.h',
197                 'nacl/loader/nonsfi/irt_basic.cc',
198                 'nacl/loader/nonsfi/irt_clock.cc',
199                 'nacl/loader/nonsfi/irt_fdio.cc',
200                 'nacl/loader/nonsfi/irt_futex.cc',
201                 'nacl/loader/nonsfi/irt_interfaces.cc',
202                 'nacl/loader/nonsfi/irt_interfaces.h',
203                 'nacl/loader/nonsfi/irt_memory.cc',
204                 'nacl/loader/nonsfi/irt_thread.cc',
205                 'nacl/loader/nonsfi/irt_util.h',
206                 'nacl/loader/nonsfi/nonsfi_main.cc',
207                 'nacl/loader/nonsfi/nonsfi_main.h',
208                 '../base/posix/unix_domain_socket_linux.cc',
209                 '../content/common/child_process_sandbox_support_impl_shm_linux.cc',
210                 '../content/common/sandbox_linux/sandbox_bpf_base_policy_linux.cc',
211                 '../content/common/sandbox_linux/sandbox_init_linux.cc',
212                 '../content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc',
213                 '../content/public/common/content_switches.cc',
214               ],
215               'conditions': [
216                 ['toolkit_uses_gtk == 1', {
217                   'dependencies': [
218                     '../build/linux/system.gyp:gtk',
219                   ],
220                 }],
221                 ['use_glib == 1', {
222                   'dependencies': [
223                     '../build/linux/system.gyp:glib',
224                   ],
225                 }],
226                 ['os_posix == 1 and OS != "mac"', {
227                   'conditions': [
228                     ['linux_use_tcmalloc==1', {
229                       'dependencies': [
230                         '../base/allocator/allocator.gyp:allocator',
231                       ],
232                     }],
233                   ],
234                 }],
235                 ['use_seccomp_bpf == 0', {
236                   'sources!': [
237                     '../content/common/sandbox_linux/sandbox_bpf_base_policy_linux.cc',
238                     '../content/common/sandbox_linux/sandbox_init_linux.cc',
239                   ],
240                 }, {
241                   'defines': ['USE_SECCOMP_BPF'],
242                 }],
243               ],
244               'cflags': ['-fPIE'],
245               'link_settings': {
246                 'ldflags': ['-pie'],
247               },
248             },
249           ],
250         }],
251         ['OS=="win" and target_arch=="ia32"', {
252           'targets': [
253             {
254               'target_name': 'nacl_win64',
255               'type': 'static_library',
256               'variables': {
257                 'nacl_target': 1,
258               },
259               'dependencies': [
260                 'nacl_common_win64',
261                 '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome64',
262                 '../ppapi/ppapi_internal.gyp:ppapi_shared_win64',
263                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
264               ],
265               'export_dependent_settings': [
266                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
267               ],
268               'sources': [
269                 '../components/nacl/broker/nacl_broker_listener.cc',
270                 '../components/nacl/broker/nacl_broker_listener.h',
271                 '../components/nacl/common/nacl_debug_exception_handler_win.cc',
272                 '../components/nacl/loader/nacl_helper_win_64.cc',
273                 '../components/nacl/loader/nacl_helper_win_64.h',
274               ],
275               'include_dirs': [
276                 '..',
277               ],
278               'defines': [
279                 '<@(nacl_win64_defines)',
280                 'COMPILE_CONTENT_STATICALLY',
281               ],
282               'configurations': {
283                 'Common_Base': {
284                   'msvs_target_platform': 'x64',
285                 },
286               },
287               'direct_dependent_settings': {
288                 'defines': [
289                   '<@(nacl_defines)',
290                 ],
291               },
292             },
293             {
294               'target_name': 'nacl_switches_win64',
295               'type': 'static_library',
296               'sources': [
297                 'nacl/common/nacl_switches.cc',
298                 'nacl/common/nacl_switches.h',
299               ],
300               'include_dirs': [
301                 '..',
302               ],
303               'configurations': {
304                 'Common_Base': {
305                   'msvs_target_platform': 'x64',
306                 },
307               },
308             },
309             {
310               'target_name': 'nacl_common_win64',
311               'type': 'static_library',
312               'defines': [
313                 'COMPILE_CONTENT_STATICALLY',
314               ],
315               'sources': [
316                 'nacl/common/nacl_cmd_line.cc',
317                 'nacl/common/nacl_cmd_line.h',
318                 'nacl/common/nacl_messages.cc',
319                 'nacl/common/nacl_messages.h',
320                 'nacl/common/nacl_types.cc',
321                 'nacl/common/nacl_types.h',
322               ],
323               'include_dirs': [
324                 '..',
325               ],
326               'configurations': {
327                 'Common_Base': {
328                   'msvs_target_platform': 'x64',
329                 },
330               },
331             },
332           ],
333         }],
334       ],
335     }, {  # else (disable_nacl==1)
336       'targets': [
337         {
338           'target_name': 'nacl',
339           'type': 'none',
340           'sources': [],
341         },
342       ],
343       'conditions': [
344         ['OS=="win"', {
345           'targets': [
346             {
347               'target_name': 'nacl_win64',
348               'type': 'none',
349               'sources': [],
350             },
351             {
352               'target_name': 'nacl_switches_win64',
353               'type': 'none',
354               'sources': [],
355             },
356           ],
357         }],
358       ],
359     }],
360   ],
361   'targets': [
362     {
363       'target_name': 'nacl_switches',
364       'type': 'static_library',
365       'sources': [
366         'nacl/common/nacl_switches.cc',
367         'nacl/common/nacl_switches.h',
368     ],
369       'include_dirs': [
370         '..',
371       ],
372     },
373     {
374       'target_name': 'nacl_common',
375       'type': 'static_library',
376       'sources': [
377         'nacl/common/nacl_cmd_line.cc',
378         'nacl/common/nacl_cmd_line.h',
379         'nacl/common/nacl_host_messages.h',
380         'nacl/common/nacl_host_messages.cc',
381         'nacl/common/nacl_messages.cc',
382         'nacl/common/nacl_messages.h',
383         'nacl/common/nacl_process_type.h',
384         'nacl/common/nacl_sandbox_type_mac.h',
385         'nacl/common/nacl_types.cc',
386         'nacl/common/nacl_types.h',
387         'nacl/common/pnacl_types.cc',
388         'nacl/common/pnacl_types.h',
389       ],
390       'include_dirs': [
391         '..',
392       ],
393     },
394   ]