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.
11 '../build/common_untrusted.gypi',
16 'target_name': 'ppapi_cpp_lib',
19 'nlib_target': 'libppapi_cpp.a',
20 'nso_target': 'libppapi_cpp.so',
23 'build_pnacl_newlib': 1,
25 '<@(cpp_source_files)',
26 'cpp/module_embedder.h',
27 'cpp/ppp_entrypoints.cc',
32 'target_name': 'ppapi_gles2_lib',
35 'nlib_target': 'libppapi_gles2.a',
36 'nso_target': 'libppapi_gles2.so',
39 'build_pnacl_newlib': 1,
44 'lib/gl/gles2/gl2ext_ppapi.c',
45 'lib/gl/gles2/gl2ext_ppapi.h',
46 'lib/gl/gles2/gles2.c',
51 'target_name': 'ppapi_nacl_tests',
54 '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
55 '<(DEPTH)/native_client/src/untrusted/pthread/pthread.gyp:pthread_lib',
57 'native_client/native_client.gyp:ppapi_lib',
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
66 '-DGL_GLEXT_PROTOTYPES',
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.
76 'GL_GLEXT_PROTOTYPES',
78 'nexe_target': 'ppapi_nacl_tests',
96 ['target_arch=="ia32"', {
97 'extra_deps_newlib32': [
98 '>(tc_lib_dir_newlib32)/libppapi_cpp.a',
99 '>(tc_lib_dir_newlib32)/libppapi.a',
101 'extra_deps_glibc32': [
102 '>(tc_lib_dir_glibc32)/libppapi_cpp.so',
103 '>(tc_lib_dir_glibc32)/libppapi.so',
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',
111 'extra_deps_glibc64': [
112 '>(tc_lib_dir_glibc64)/libppapi_cpp.so',
113 '>(tc_lib_dir_glibc64)/libppapi.so',
116 ['target_arch=="arm"', {
118 '>(tc_lib_dir_newlib_arm)/libppapi_cpp.a',
119 '>(tc_lib_dir_newlib_arm)/libppapi.a',
123 'extra_deps_pnacl_newlib': [
124 '>(tc_lib_dir_pnacl_newlib)/libppapi_cpp.a',
125 '>(tc_lib_dir_pnacl_newlib)/libppapi.a',
128 '<@(test_common_source_files)',
129 '<@(test_nacl_source_files)',
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',
139 'create_nonsfi_test_nmf': 'tests/create_nonsfi_test_nmf.py',
142 ['(target_arch=="ia32" or target_arch=="x64") and disable_glibc==0', {
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',
153 'action_name': 'Generate GLIBC NMF and copy libs',
154 # NOTE: create_nmf must be first, it is the script python executes
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)'],
164 '>@(create_nmf_flags)',
165 '--output=>(nmf_glibc)',
166 '--stage-dependencies=<(PRODUCT_DIR)',
169 ['target_arch=="ia32"', {
171 '--library-path=>(libdir_glibc32)',
172 '--library-path=>(tc_lib_dir_glibc32)',
174 'inputs': ['>(out_glibc32)'],
176 ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', {
178 '--library-path=>(libdir_glibc64)',
179 '--library-path=>(tc_lib_dir_glibc64)',
181 'inputs': ['>(out_glibc64)'],
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
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")', {
197 'build_pnacl_newlib': 1,
198 'translate_pexe_with_build': 1,
199 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
201 # Shim is a dependency for the nexe because we pre-translate.
203 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
207 'action_name': 'Generate PNACL NEWLIB NMF',
208 # NOTE: create_nmf must be first, it is the script python executes
213 'outputs': ['>(nmf_pnacl)'],
217 '>@(create_nmf_flags)',
218 '--output=>(nmf_pnacl)',
221 ['target_arch=="ia32"', {
223 '>(out_pnacl_newlib_x86_32_nexe)',
226 ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', {
228 '>(out_pnacl_newlib_x86_64_nexe)',
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
240 'translate_pexe_with_build': 1,
241 'nmf_nonsfi%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_nonsfi.nmf',
244 ['target_arch=="ia32" or target_arch=="x64"', {
246 'enable_x86_32_nonsfi': 1,
249 ['target_arch=="arm"', {
251 'enable_arm_nonsfi': 1,
255 # Shim is a dependency for the nexe because we pre-translate.
257 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
261 'action_name': 'Generate PNACL NEWLIB NONSFI NMF',
262 'inputs': ['>(create_nonsfi_test_nmf)'],
263 'outputs': ['>(nmf_nonsfi)'],
266 '>(create_nonsfi_test_nmf)',
267 '--output=>(nmf_nonsfi)',
269 'target_conditions': [
270 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="ia32"', {
271 'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'],
273 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
277 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="x64"', {
278 'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'],
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
289 # TODO(hidehiko): Remove this hack.
293 ['enable_arm_nonsfi==1', {
294 'inputs': ['>(out_pnacl_newlib_arm_nonsfi_nexe)'],
296 '--program=>(out_pnacl_newlib_arm_nonsfi_nexe)',
304 ['disable_pnacl==0 and target_arch=="arm"', {
306 'build_pnacl_newlib': 1,
307 'translate_pexe_with_build': 1,
308 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
310 # Shim is a dependency for the nexe because we pre-translate.
312 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
316 'action_name': 'Generate PNACL NEWLIB NMF',
317 # NOTE: create_nmf must be first, it is the script python executes
319 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_arm_nexe)'],
320 'outputs': ['>(nmf_pnacl)'],
324 '>@(create_nmf_flags)',
325 '--output=>(nmf_pnacl)',
330 ['disable_pnacl==0 and target_arch=="mipsel"', {
332 'build_pnacl_newlib': 1,
333 'translate_pexe_with_build': 1,
334 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
336 # Shim is a dependency for the nexe because we pre-translate.
338 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
342 'action_name': 'Generate PNACL NEWLIB NMF',
343 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_mips_nexe)'],
344 'outputs': ['>(nmf_pnacl)'],
348 '>@(create_nmf_flags)',
349 '--output=>(nmf_pnacl)',