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',
21 'nacl_untrusted_build': 1,
24 'build_pnacl_newlib': 1,
26 '<@(cpp_source_files)',
27 'cpp/module_embedder.h',
28 'cpp/ppp_entrypoints.cc',
33 'target_name': 'ppapi_gles2_lib',
36 'nlib_target': 'libppapi_gles2.a',
37 'nacl_untrusted_build': 1,
38 'nso_target': 'libppapi_gles2.so',
41 'build_pnacl_newlib': 1,
46 'lib/gl/gles2/gl2ext_ppapi.c',
47 'lib/gl/gles2/gl2ext_ppapi.h',
48 'lib/gl/gles2/gles2.c',
53 'target_name': 'ppapi_nacl_tests',
56 '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
57 '<(DEPTH)/native_client/src/untrusted/pthread/pthread.gyp:pthread_lib',
59 'native_client/native_client.gyp:ppapi_lib',
62 # This is user code (vs IRT code), so tls accesses do not
63 # need to be indirect through a function call.
64 'newlib_tls_flags=': [],
65 # TODO(bradnelson): Remove this compile flag once new nacl_rev is
68 '-DGL_GLEXT_PROTOTYPES',
70 # Speed up pnacl linking by not generating debug info for tests.
71 # We compile with --strip-all under extra_args so debug info is
72 # discarded anyway. Remove this and the --strip-all flag if
73 # debug info is really needed.
78 'GL_GLEXT_PROTOTYPES',
80 'nexe_target': 'ppapi_nacl_tests',
81 'nacl_untrusted_build': 1,
99 ['target_arch=="ia32"', {
100 'extra_deps_newlib32': [
101 '>(tc_lib_dir_newlib32)/libppapi_cpp.a',
102 '>(tc_lib_dir_newlib32)/libppapi.a',
104 'extra_deps_glibc32': [
105 '>(tc_lib_dir_glibc32)/libppapi_cpp.so',
106 '>(tc_lib_dir_glibc32)/libppapi.so',
109 ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', {
110 'extra_deps_newlib64': [
111 '>(tc_lib_dir_newlib64)/libppapi_cpp.a',
112 '>(tc_lib_dir_newlib64)/libppapi.a',
114 'extra_deps_glibc64': [
115 '>(tc_lib_dir_glibc64)/libppapi_cpp.so',
116 '>(tc_lib_dir_glibc64)/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_nmf_flags': [
139 '--no-default-libpath',
140 '--objdump=>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
142 'create_nonsfi_test_nmf': 'tests/create_nonsfi_test_nmf.py',
145 ['(target_arch=="ia32" or target_arch=="x64") and disable_glibc==0', {
148 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
149 # doesn't work on Windows.
150 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
151 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
152 'nmf_glibc%': '<(PRODUCT_DIR)/>(nexe_target)_glibc.nmf',
156 'action_name': 'Generate GLIBC NMF and copy libs',
157 # NOTE: create_nmf must be first, it is the script python executes
159 'inputs': ['>(create_nmf)'],
160 # NOTE: There is no explicit dependency for the lib32
161 # and lib64 directories created in the PRODUCT_DIR.
162 # They are created as a side-effect of NMF creation.
163 'outputs': ['>(nmf_glibc)'],
167 '>@(create_nmf_flags)',
168 '--output=>(nmf_glibc)',
169 '--stage-dependencies=<(PRODUCT_DIR)',
172 ['target_arch=="ia32"', {
174 '--library-path=>(libdir_glibc32)',
175 '--library-path=>(tc_lib_dir_glibc32)',
177 'inputs': ['>(out_glibc32)'],
179 ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', {
181 '--library-path=>(libdir_glibc64)',
182 '--library-path=>(tc_lib_dir_glibc64)',
184 'inputs': ['>(out_glibc64)'],
190 # Test PNaCl pre-translated code (pre-translated to save bot time).
191 # We only care about testing that code generation is correct,
192 # and in-browser translation is tested elsewhere.
193 # NOTE: native_client/build/untrusted.gypi dictates that
194 # PNaCl only generate x86-32 and x86-64 on x86 platforms,
195 # ARM on ARM platforms, or MIPS on MIPS platforms, not all
197 # The same goes for the PNaCl shims. So, we have two variations here.
198 ['disable_pnacl==0 and (target_arch=="ia32" or target_arch=="x64")', {
200 'build_pnacl_newlib': 1,
201 'translate_pexe_with_build': 1,
202 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
204 # Shim is a dependency for the nexe because we pre-translate.
206 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
210 'action_name': 'Generate PNACL NEWLIB NMF',
211 # NOTE: create_nmf must be first, it is the script python executes
216 'outputs': ['>(nmf_pnacl)'],
220 '>@(create_nmf_flags)',
221 '--output=>(nmf_pnacl)',
224 ['target_arch=="ia32"', {
226 '>(out_pnacl_newlib_x86_32_nexe)',
229 ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', {
231 '>(out_pnacl_newlib_x86_64_nexe)',
238 ['disable_pnacl==0 and (target_arch=="ia32" or target_arch=="x64" or target_arch=="arm") and OS=="linux"', {
239 # In addition to above configuration, build x86-32 and arm nonsfi
240 # .nexe files by translating from .pexe binary, for non-SFI mode PPAPI
243 'translate_pexe_with_build': 1,
244 'nmf_nonsfi%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_nonsfi.nmf',
247 ['target_arch=="ia32" or target_arch=="x64"', {
249 'enable_x86_32_nonsfi': 1,
252 ['target_arch=="arm"', {
254 'enable_arm_nonsfi': 1,
258 # Shim is a dependency for the nexe because we pre-translate.
260 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
264 'action_name': 'Generate PNACL NEWLIB NONSFI NMF',
265 'inputs': ['>(create_nonsfi_test_nmf)'],
266 'outputs': ['>(nmf_nonsfi)'],
269 '>(create_nonsfi_test_nmf)',
270 '--output=>(nmf_nonsfi)',
272 'target_conditions': [
273 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="ia32"', {
274 'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'],
276 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
280 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="x64"', {
281 'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'],
283 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
284 # This should be used only for nacl_helper_nonsfi test.
285 # In theory this should be x86-32. However, currently
286 # fallback logic to x86-32-nonsfi is not implemented,
287 # and, moreover, it would break the tests for current
288 # nacl_helper in Non-SFI mode on x64 Chrome.
289 # So, here we introduce the hack to use "x86-64" in order
290 # to take the benefit to run nacl_helper_nonsfi tests on
292 # TODO(hidehiko): Remove this hack.
296 ['enable_arm_nonsfi==1', {
297 'inputs': ['>(out_pnacl_newlib_arm_nonsfi_nexe)'],
299 '--program=>(out_pnacl_newlib_arm_nonsfi_nexe)',
307 ['disable_pnacl==0 and target_arch=="arm"', {
309 'build_pnacl_newlib': 1,
310 'translate_pexe_with_build': 1,
311 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
313 # Shim is a dependency for the nexe because we pre-translate.
315 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
319 'action_name': 'Generate PNACL NEWLIB NMF',
320 # NOTE: create_nmf must be first, it is the script python executes
322 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_arm_nexe)'],
323 'outputs': ['>(nmf_pnacl)'],
327 '>@(create_nmf_flags)',
328 '--output=>(nmf_pnacl)',
333 ['disable_pnacl==0 and target_arch=="mipsel"', {
335 'build_pnacl_newlib': 1,
336 'translate_pexe_with_build': 1,
337 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
339 # Shim is a dependency for the nexe because we pre-translate.
341 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
345 'action_name': 'Generate PNACL NEWLIB NMF',
346 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_mips_nexe)'],
347 'outputs': ['>(nmf_pnacl)'],
351 '>@(create_nmf_flags)',
352 '--output=>(nmf_pnacl)',