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/src/untrusted/nacl/nacl.gyp:nacl_lib',
62 'native_client/native_client.gyp:ppapi_lib',
65 # This is user code (vs IRT code), so tls accesses do not
66 # need to be indirect through a function call.
67 'newlib_tls_flags=': [],
68 # TODO(bradnelson): Remove this compile flag once new nacl_rev is
71 '-DGL_GLEXT_PROTOTYPES',
73 # Speed up pnacl linking by not generating debug info for tests.
74 # We compile with --strip-all under extra_args so debug info is
75 # discarded anyway. Remove this and the --strip-all flag if
76 # debug info is really needed.
81 'GL_GLEXT_PROTOTYPES',
83 'nexe_target': 'ppapi_nacl_tests',
101 ['target_arch=="ia32" or target_arch=="x64"', {
102 'extra_deps_newlib64': [
103 '>(tc_lib_dir_newlib64)/libppapi_cpp.a',
104 '>(tc_lib_dir_newlib64)/libppapi.a',
106 'extra_deps_newlib32': [
107 '>(tc_lib_dir_newlib32)/libppapi_cpp.a',
108 '>(tc_lib_dir_newlib32)/libppapi.a',
110 'extra_deps_glibc64': [
111 '>(tc_lib_dir_glibc64)/libppapi_cpp.so',
112 '>(tc_lib_dir_glibc64)/libppapi.so',
114 'extra_deps_glibc32': [
115 '>(tc_lib_dir_glibc32)/libppapi_cpp.so',
116 '>(tc_lib_dir_glibc32)/libppapi.so',
119 ['target_arch=="arm"', {
121 '>(tc_lib_dir_newlib_arm)/libppapi_cpp.a',
122 '>(tc_lib_dir_newlib_arm)/libppapi.a',
126 'extra_deps_pnacl_newlib': [
127 '>(tc_lib_dir_pnacl_newlib)/libppapi_cpp.a',
128 '>(tc_lib_dir_pnacl_newlib)/libppapi.a',
131 '<@(test_common_source_files)',
132 '<@(test_nacl_source_files)',
137 'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
138 'create_nonsfi_test_nmf': 'tests/create_nonsfi_test_nmf.py',
141 ['target_arch!="arm" and target_arch!="mipsel" and disable_glibc==0', {
144 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
145 # doesn't work on Windows.
146 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
147 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
148 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
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)', '>(out_glibc64)', '>(out_glibc32)'],
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 '--objdump=>(nacl_objdump)',
165 '--library-path=>(libdir_glibc64)',
166 '--library-path=>(libdir_glibc32)',
167 '--library-path=>(tc_lib_dir_glibc32)',
168 '--library-path=>(tc_lib_dir_glibc64)',
169 '--output=>(nmf_glibc)',
170 '--stage-dependencies=<(PRODUCT_DIR)',
175 # Test PNaCl pre-translated code (pre-translated to save bot time).
176 # We only care about testing that code generation is correct,
177 # and in-browser translation is tested elsewhere.
178 # NOTE: native_client/build/untrusted.gypi dictates that
179 # PNaCl only generate x86-32 and x86-64 on x86 platforms,
180 # ARM on ARM platforms, or MIPS on MIPS platforms, not all
182 # The same goes for the PNaCl shims. So, we have two variations here.
183 ['disable_pnacl==0 and (target_arch=="ia32" or target_arch=="x64")', {
185 'build_pnacl_newlib': 1,
186 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
188 # Shim is a dependency for the nexe because we pre-translate.
190 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:shim_aot',
194 'action_name': 'Generate PNACL NEWLIB NMF',
195 # NOTE: create_nmf must be first, it is the script python executes
199 '>(out_pnacl_newlib_x86_32_nexe)',
200 '>(out_pnacl_newlib_x86_64_nexe)'
202 'outputs': ['>(nmf_pnacl)'],
206 '--output=>(nmf_pnacl)',
211 ['disable_pnacl==0 and target_arch=="ia32" and OS=="linux"', {
212 # In addition to above configuration, build x86-32-nonsfi .nexe file
213 # by translating from .pexe binary, for non-SFI mode PPAPI testing.
215 'enable_x86_32_nonsfi': 1,
216 'nmf_nonsfi%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_nonsfi.nmf',
220 'action_name': 'Generate PNACL NEWLIB NONSFI NMF',
221 'inputs': ['>(create_nonsfi_test_nmf)'],
222 'outputs': ['>(nmf_nonsfi)'],
225 '>(create_nonsfi_test_nmf)',
226 '--output=>(nmf_nonsfi)',
227 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
232 ['disable_pnacl==0 and target_arch=="arm"', {
234 'build_pnacl_newlib': 1,
235 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
237 # Shim is a dependency for the nexe because we pre-translate.
239 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:shim_aot',
243 'action_name': 'Generate PNACL NEWLIB NMF',
244 # NOTE: create_nmf must be first, it is the script python executes
246 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_arm_nexe)'],
247 'outputs': ['>(nmf_pnacl)'],
251 '--output=>(nmf_pnacl)',
256 ['disable_pnacl==0 and target_arch=="mipsel"', {
258 'build_pnacl_newlib': 1,
259 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
261 # Shim is a dependency for the nexe because we pre-translate.
263 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:shim_aot',
267 'action_name': 'Generate PNACL NEWLIB NMF',
268 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_mips_nexe)'],
269 'outputs': ['>(nmf_pnacl)'],
273 '--output=>(nmf_pnacl)',