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 '../native_client/build/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',
31 '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
35 'target_name': 'ppapi_gles2_lib',
38 'nlib_target': 'libppapi_gles2.a',
39 'nso_target': 'libppapi_gles2.so',
42 'build_pnacl_newlib': 1,
47 'lib/gl/gles2/gl2ext_ppapi.c',
48 'lib/gl/gles2/gl2ext_ppapi.h',
49 'lib/gl/gles2/gles2.c',
53 '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
57 'target_name': 'ppapi_nacl_tests',
60 '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
61 '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
62 '<(DEPTH)/native_client/src/untrusted/pthread/pthread.gyp:pthread_lib',
64 'native_client/native_client.gyp:ppapi_lib',
67 # This is user code (vs IRT code), so tls accesses do not
68 # need to be indirect through a function call.
69 'newlib_tls_flags=': [],
70 # TODO(bradnelson): Remove this compile flag once new nacl_rev is
73 '-DGL_GLEXT_PROTOTYPES',
75 # Speed up pnacl linking by not generating debug info for tests.
76 # We compile with --strip-all under extra_args so debug info is
77 # discarded anyway. Remove this and the --strip-all flag if
78 # debug info is really needed.
83 'GL_GLEXT_PROTOTYPES',
85 'nexe_target': 'ppapi_nacl_tests',
103 ['target_arch=="ia32" or target_arch=="x64"', {
104 'extra_deps_newlib64': [
105 '>(tc_lib_dir_newlib64)/libppapi_cpp.a',
106 '>(tc_lib_dir_newlib64)/libppapi.a',
108 'extra_deps_newlib32': [
109 '>(tc_lib_dir_newlib32)/libppapi_cpp.a',
110 '>(tc_lib_dir_newlib32)/libppapi.a',
112 'extra_deps_glibc64': [
113 '>(tc_lib_dir_glibc64)/libppapi_cpp.so',
114 '>(tc_lib_dir_glibc64)/libppapi.so',
116 'extra_deps_glibc32': [
117 '>(tc_lib_dir_glibc32)/libppapi_cpp.so',
118 '>(tc_lib_dir_glibc32)/libppapi.so',
121 ['target_arch=="arm"', {
123 '>(tc_lib_dir_newlib_arm)/libppapi_cpp.a',
124 '>(tc_lib_dir_newlib_arm)/libppapi.a',
128 'extra_deps_pnacl_newlib': [
129 '>(tc_lib_dir_pnacl_newlib)/libppapi_cpp.a',
130 '>(tc_lib_dir_pnacl_newlib)/libppapi.a',
133 '<@(test_common_source_files)',
134 '<@(test_nacl_source_files)',
139 'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
140 'create_nonsfi_test_nmf': 'tests/create_nonsfi_test_nmf.py',
143 ['target_arch!="arm" and target_arch!="mipsel" and disable_glibc==0', {
146 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
147 # doesn't work on Windows.
148 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
149 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
150 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
151 'nmf_glibc%': '<(PRODUCT_DIR)/>(nexe_target)_glibc.nmf',
155 'action_name': 'Generate GLIBC NMF and copy libs',
156 # NOTE: create_nmf must be first, it is the script python executes
158 'inputs': ['>(create_nmf)', '>(out_glibc64)', '>(out_glibc32)'],
159 # NOTE: There is no explicit dependency for the lib32
160 # and lib64 directories created in the PRODUCT_DIR.
161 # They are created as a side-effect of NMF creation.
162 'outputs': ['>(nmf_glibc)'],
166 '--objdump=>(nacl_objdump)',
167 '--library-path=>(libdir_glibc64)',
168 '--library-path=>(libdir_glibc32)',
169 '--library-path=>(tc_lib_dir_glibc32)',
170 '--library-path=>(tc_lib_dir_glibc64)',
171 '--output=>(nmf_glibc)',
172 '--stage-dependencies=<(PRODUCT_DIR)',
177 # Test PNaCl pre-translated code (pre-translated to save bot time).
178 # We only care about testing that code generation is correct,
179 # and in-browser translation is tested elsewhere.
180 # NOTE: native_client/build/untrusted.gypi dictates that
181 # PNaCl only generate x86-32 and x86-64 on x86 platforms,
182 # ARM on ARM platforms, or MIPS on MIPS platforms, not all
184 # The same goes for the PNaCl shims. So, we have two variations here.
185 ['disable_pnacl==0 and (target_arch=="ia32" or target_arch=="x64")', {
187 'build_pnacl_newlib': 1,
188 'translate_pexe_with_build': 1,
189 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
191 # Shim is a dependency for the nexe because we pre-translate.
193 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
197 'action_name': 'Generate PNACL NEWLIB NMF',
198 # NOTE: create_nmf must be first, it is the script python executes
202 '>(out_pnacl_newlib_x86_32_nexe)',
203 '>(out_pnacl_newlib_x86_64_nexe)'
205 'outputs': ['>(nmf_pnacl)'],
209 '--output=>(nmf_pnacl)',
214 ['disable_pnacl==0 and target_arch=="ia32" and OS=="linux"', {
215 # In addition to above configuration, build x86-32-nonsfi .nexe file
216 # by translating from .pexe binary, for non-SFI mode PPAPI testing.
218 'enable_x86_32_nonsfi': 1,
219 'translate_pexe_with_build': 1,
220 'nmf_nonsfi%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_nonsfi.nmf',
222 # Shim is a dependency for the nexe because we pre-translate.
224 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
228 'action_name': 'Generate PNACL NEWLIB NONSFI NMF',
229 'inputs': ['>(create_nonsfi_test_nmf)'],
230 'outputs': ['>(nmf_nonsfi)'],
233 '>(create_nonsfi_test_nmf)',
234 '--output=>(nmf_nonsfi)',
235 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
240 ['disable_pnacl==0 and target_arch=="arm"', {
242 'build_pnacl_newlib': 1,
243 'translate_pexe_with_build': 1,
244 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
246 # Shim is a dependency for the nexe because we pre-translate.
248 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
252 'action_name': 'Generate PNACL NEWLIB NMF',
253 # NOTE: create_nmf must be first, it is the script python executes
255 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_arm_nexe)'],
256 'outputs': ['>(nmf_pnacl)'],
260 '--output=>(nmf_pnacl)',
265 ['disable_pnacl==0 and target_arch=="mipsel"', {
267 'build_pnacl_newlib': 1,
268 'translate_pexe_with_build': 1,
269 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
271 # Shim is a dependency for the nexe because we pre-translate.
273 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
277 'action_name': 'Generate PNACL NEWLIB NMF',
278 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_mips_nexe)'],
279 'outputs': ['>(nmf_pnacl)'],
283 '--output=>(nmf_pnacl)',