[Telemetry] Remove adb_commands usage from android_device.
[chromium-blink-merge.git] / ppapi / ppapi_nacl.gyp
blobaa7b718bec8394f59bc86d589545a1a395aecbfe
1 # Copyright 2014 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.
5 # This GYP file defines untrusted (NaCl) targets.  All targets in this
6 # file should be conditionally depended upon via 'disable_nacl!=1' to avoid
7 # requiring NaCl sources for building.
10   'includes': [
11     '../build/common_untrusted.gypi',
12     'ppapi_sources.gypi',
13   ],
14   'targets': [
15     {
16       'target_name': 'ppapi_cpp_lib',
17       'type': 'none',
18       'variables': {
19         'nlib_target': 'libppapi_cpp.a',
20         'nso_target': 'libppapi_cpp.so',
21         'build_glibc': 1,
22         'build_newlib': 1,
23         'build_pnacl_newlib': 1,
24         'sources': [
25           '<@(cpp_source_files)',
26           'cpp/module_embedder.h',
27           'cpp/ppp_entrypoints.cc',
28         ],
29       },
30     },
31     {
32       'target_name': 'ppapi_gles2_lib',
33       'type': 'none',
34       'variables': {
35         'nlib_target': 'libppapi_gles2.a',
36         'nso_target': 'libppapi_gles2.so',
37         'build_glibc': 1,
38         'build_newlib': 1,
39         'build_pnacl_newlib': 1,
40         'include_dirs': [
41           'lib/gl/include',
42         ],
43         'sources': [
44           'lib/gl/gles2/gl2ext_ppapi.c',
45           'lib/gl/gles2/gl2ext_ppapi.h',
46           'lib/gl/gles2/gles2.c',
47         ],
48       },
49     },
50     {
51       'target_name': 'ppapi_nacl_tests',
52       'type': 'none',
53       'dependencies': [
54          '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
55          '<(DEPTH)/native_client/src/untrusted/pthread/pthread.gyp:pthread_lib',
56          'ppapi_cpp_lib',
57          'native_client/native_client.gyp:ppapi_lib',
58       ],
59       'variables': {
60         # This is user code (vs IRT code), so tls accesses do not
61         # need to be indirect through a function call.
62         'newlib_tls_flags=': [],
63         # TODO(bradnelson): Remove this compile flag once new nacl_rev is
64         # above 9362.
65         'compile_flags': [
66           '-DGL_GLEXT_PROTOTYPES',
67         ],
68         # Speed up pnacl linking by not generating debug info for tests.
69         # We compile with --strip-all under extra_args so debug info is
70         # discarded anyway.  Remove this and the --strip-all flag if
71         # debug info is really needed.
72         'compile_flags!': [
73           '-g',
74         ],
75         'defines': [
76           'GL_GLEXT_PROTOTYPES',
77         ],
78         'nexe_target': 'ppapi_nacl_tests',
79         'build_newlib': 1,
80         'include_dirs': [
81           'lib/gl/include',
82           '..',
83         ],
84         'link_flags': [
85           '-lppapi_cpp',
86           '-lppapi',
87           '-pthread',
88         ],
89         'link_flags!': [
90           '-O3',
91         ],
92         'translate_flags': [
93           '-O0',
94         ],
95         'conditions': [
96           ['target_arch=="ia32"', {
97             'extra_deps_newlib32': [
98               '>(tc_lib_dir_newlib32)/libppapi_cpp.a',
99               '>(tc_lib_dir_newlib32)/libppapi.a',
100             ],
101             'extra_deps_glibc32': [
102               '>(tc_lib_dir_glibc32)/libppapi_cpp.so',
103               '>(tc_lib_dir_glibc32)/libppapi.so',
104             ],
105           }],
106           ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', {
107             'extra_deps_newlib64': [
108               '>(tc_lib_dir_newlib64)/libppapi_cpp.a',
109               '>(tc_lib_dir_newlib64)/libppapi.a',
110             ],
111             'extra_deps_glibc64': [
112               '>(tc_lib_dir_glibc64)/libppapi_cpp.so',
113               '>(tc_lib_dir_glibc64)/libppapi.so',
114             ],
115           }],
116           ['target_arch=="arm"', {
117             'extra_deps_arm': [
118               '>(tc_lib_dir_newlib_arm)/libppapi_cpp.a',
119               '>(tc_lib_dir_newlib_arm)/libppapi.a',
120             ],
121           }],
122         ],
123         'extra_deps_pnacl_newlib': [
124           '>(tc_lib_dir_pnacl_newlib)/libppapi_cpp.a',
125           '>(tc_lib_dir_pnacl_newlib)/libppapi.a',
126         ],
127         'sources': [
128           '<@(test_common_source_files)',
129           '<@(test_nacl_source_files)',
130         ],
131         'extra_args': [
132           '--strip-all',
133         ],
134         'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
135         'create_nmf_flags': [
136           '--no-default-libpath',
137           '--objdump=>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
138         ],
139         'create_nonsfi_test_nmf': 'tests/create_nonsfi_test_nmf.py',
140       },
141       'conditions': [
142         ['(target_arch=="ia32" or target_arch=="x64") and disable_glibc==0', {
143           'variables': {
144             'build_glibc': 1,
145             # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
146             # doesn't work on Windows.
147             'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
148             'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
149             'nmf_glibc%': '<(PRODUCT_DIR)/>(nexe_target)_glibc.nmf',
150           },
151           'actions': [
152           {
153             'action_name': 'Generate GLIBC NMF and copy libs',
154             # NOTE: create_nmf must be first, it is the script python executes
155             # below.
156             'inputs': ['>(create_nmf)'],
157             # NOTE: There is no explicit dependency for the lib32
158             # and lib64 directories created in the PRODUCT_DIR.
159             # They are created as a side-effect of NMF creation.
160             'outputs': ['>(nmf_glibc)'],
161             'action': [
162               'python',
163               '>@(_inputs)',
164               '>@(create_nmf_flags)',
165               '--output=>(nmf_glibc)',
166               '--stage-dependencies=<(PRODUCT_DIR)',
167             ],
168             'conditions': [
169               ['target_arch=="ia32"', {
170                 'action': [
171                   '--library-path=>(libdir_glibc32)',
172                   '--library-path=>(tc_lib_dir_glibc32)',
173                 ],
174                 'inputs': ['>(out_glibc32)'],
175               }],
176               ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', {
177                 'action': [
178                   '--library-path=>(libdir_glibc64)',
179                   '--library-path=>(tc_lib_dir_glibc64)',
180                 ],
181                 'inputs': ['>(out_glibc64)'],
182               }],
183             ],
184           },
185         ],
186         }],
187         # Test PNaCl pre-translated code (pre-translated to save bot time).
188         # We only care about testing that code generation is correct,
189         # and in-browser translation is tested elsewhere.
190         # NOTE: native_client/build/untrusted.gypi dictates that
191         # PNaCl only generate x86-32 and x86-64 on x86 platforms,
192         # ARM on ARM platforms, or MIPS on MIPS platforms, not all
193         # versions always.
194         # The same goes for the PNaCl shims. So, we have two variations here.
195         ['disable_pnacl==0 and (target_arch=="ia32" or target_arch=="x64")', {
196           'variables': {
197             'build_pnacl_newlib': 1,
198             'translate_pexe_with_build': 1,
199             'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
200           },
201           # Shim is a dependency for the nexe because we pre-translate.
202           'dependencies': [
203             '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
204           ],
205           'actions': [
206             {
207               'action_name': 'Generate PNACL NEWLIB NMF',
208               # NOTE: create_nmf must be first, it is the script python executes
209               # below.
210               'inputs': [
211                 '>(create_nmf)',
212               ],
213               'outputs': ['>(nmf_pnacl)'],
214               'action': [
215                 'python',
216                 '>@(_inputs)',
217                 '>@(create_nmf_flags)',
218                 '--output=>(nmf_pnacl)',
219               ],
220               'conditions': [
221                 ['target_arch=="ia32"', {
222                   'inputs': [
223                     '>(out_pnacl_newlib_x86_32_nexe)',
224                   ],
225                 }],
226                 ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', {
227                   'inputs': [
228                     '>(out_pnacl_newlib_x86_64_nexe)',
229                   ],
230                 }],
231               ],
232             },
233           ],
234         }],
235         ['disable_pnacl==0 and (target_arch=="ia32" or target_arch=="x64" or target_arch=="arm") and OS=="linux"', {
236           # In addition to above configuration, build x86-32 and arm nonsfi
237           # .nexe files by translating from .pexe binary, for non-SFI mode PPAPI
238           # testing.
239           'variables': {
240             'translate_pexe_with_build': 1,
241             'nmf_nonsfi%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_nonsfi.nmf',
242           },
243           'conditions': [
244             ['target_arch=="ia32" or target_arch=="x64"', {
245               'variables': {
246                 'enable_x86_32_nonsfi': 1,
247               },
248             }],
249             ['target_arch=="arm"', {
250               'variables': {
251                 'enable_arm_nonsfi': 1,
252               },
253             }],
254           ],
255           # Shim is a dependency for the nexe because we pre-translate.
256          'dependencies': [
257             '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
258           ],
259           'actions': [
260             {
261               'action_name': 'Generate PNACL NEWLIB NONSFI NMF',
262               'inputs': ['>(create_nonsfi_test_nmf)'],
263               'outputs': ['>(nmf_nonsfi)'],
264               'action': [
265                 'python',
266                 '>(create_nonsfi_test_nmf)',
267                 '--output=>(nmf_nonsfi)',
268               ],
269               'target_conditions': [
270                 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="ia32"', {
271                   'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'],
272                   'action': [
273                     '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
274                     '--arch=x86-32',
275                   ]
276                 }],
277                 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="x64"', {
278                   'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'],
279                   'action': [
280                     '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
281                     # This should be used only for nacl_helper_nonsfi test.
282                     # In theory this should be x86-32. However, currently
283                     # fallback logic to x86-32-nonsfi is not implemented,
284                     # and, moreover, it would break the tests for current
285                     # nacl_helper in Non-SFI mode on x64 Chrome.
286                     # So, here we introduce the hack to use "x86-64" in order
287                     # to take the benefit to run nacl_helper_nonsfi tests on
288                     # x64 Chrome.
289                     # TODO(hidehiko): Remove this hack.
290                     '--arch=x86-64',
291                   ]
292                 }],
293                 ['enable_arm_nonsfi==1', {
294                   'inputs': ['>(out_pnacl_newlib_arm_nonsfi_nexe)'],
295                   'action': [
296                     '--program=>(out_pnacl_newlib_arm_nonsfi_nexe)',
297                     '--arch=arm',
298                   ]
299                 }],
300               ],
301             },
302           ],
303         }],
304         ['disable_pnacl==0 and target_arch=="arm"', {
305           'variables': {
306             'build_pnacl_newlib': 1,
307             'translate_pexe_with_build': 1,
308             'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
309           },
310           # Shim is a dependency for the nexe because we pre-translate.
311           'dependencies': [
312             '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
313           ],
314           'actions': [
315             {
316               'action_name': 'Generate PNACL NEWLIB NMF',
317               # NOTE: create_nmf must be first, it is the script python executes
318               # below.
319               'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_arm_nexe)'],
320               'outputs': ['>(nmf_pnacl)'],
321               'action': [
322                 'python',
323                 '>@(_inputs)',
324                 '>@(create_nmf_flags)',
325                 '--output=>(nmf_pnacl)',
326               ],
327             },
328           ],
329         }],
330         ['disable_pnacl==0 and target_arch=="mipsel"', {
331           'variables': {
332             'build_pnacl_newlib': 1,
333             'translate_pexe_with_build': 1,
334             'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
335           },
336           # Shim is a dependency for the nexe because we pre-translate.
337           'dependencies': [
338             '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
339           ],
340           'actions': [
341             {
342               'action_name': 'Generate PNACL NEWLIB NMF',
343               'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_mips_nexe)'],
344               'outputs': ['>(nmf_pnacl)'],
345               'action': [
346                 'python',
347                 '>@(_inputs)',
348                 '>@(create_nmf_flags)',
349                 '--output=>(nmf_pnacl)',
350               ],
351             },
352           ],
353         }],
354       ],
355     },
356   ],