1 # Copyright (c) 2012 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 # TODO(bradnelson): Remove this compile flag once new nacl_rev is
68 '-DGL_GLEXT_PROTOTYPES',
71 'GL_GLEXT_PROTOTYPES',
73 'nexe_target': 'ppapi_nacl_tests',
84 # TODO(bradchen): get rid of extra_deps64 and extra_deps32
85 # once native_client/build/untrusted.gypi no longer needs them.
86 'extra_deps_newlib64': [
87 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi_cpp.a',
88 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi.a',
90 'extra_deps_newlib32': [
91 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi_cpp.a',
92 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi.a',
94 'extra_deps_glibc64': [
95 '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libppapi_cpp.so',
96 '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libppapi.so',
98 'extra_deps_glibc32': [
99 '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libppapi_cpp.so',
100 '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libppapi.so',
103 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm/libppapi_cpp.a',
104 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm/libppapi.a',
106 'extra_deps_pnacl': [
107 '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib/libppapi_cpp.a',
108 '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib/libppapi.a',
111 '<@(test_common_source_files)',
112 '<@(test_nacl_source_files)',
119 ['target_arch!="arm"', {
120 # This is user code (vs IRT code), so tls accesses do not
121 # need to be indirect through a function call.
122 # For PNaCl, the -mtls-use-call flag is localized to the
123 # IRT's translation command, so it is unnecessary to
124 # counteract that flag here.
126 'gcc_compile_flags': [
131 ['target_arch!="arm" and disable_glibc==0', {
134 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
135 # doesn't work on Windows.
136 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
137 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
138 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
139 'nmf_glibc%': '<(PRODUCT_DIR)/>(nexe_target)_glibc.nmf',
143 'action_name': 'Generate GLIBC NMF and copy libs',
144 'inputs': ['>(out_glibc64)', '>(out_glibc32)'],
145 # NOTE: There is no explicit dependency for the lib32
146 # and lib64 directories created in the PRODUCT_DIR.
147 # They are created as a side-effect of NMF creation.
148 'outputs': ['>(nmf_glibc)'],
151 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
153 '--objdump=>(nacl_objdump)',
154 '--library-path=>(libdir_glibc64)',
155 '--library-path=>(libdir_glibc32)',
156 '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32',
157 '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64',
158 '--output=>(nmf_glibc)',
159 '--stage-dependencies=<(PRODUCT_DIR)',
161 'msvs_cygwin_shell': 1,
165 # Test PNaCl pre-translated code (pre-translated to save bot time).
166 # We only care about testing that code generation is correct,
167 # and in-browser translation is tested elsewhere.
168 # NOTE: native_client/build/untrusted.gypi dictates that
169 # PNaCl only generate x86-32 and x86-64 on x86 platforms,
170 # or ARM on ARM platforms, not all versions always.
171 # The same goes for the PNaCl shims. So, we have two variations here.
172 ['disable_pnacl==0 and target_arch!="arm"', {
174 'build_pnacl_newlib': 1,
175 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
177 # Shim is a dependency for the nexe because we pre-translate.
179 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
183 'action_name': 'Generate PNACL NEWLIB NMF',
184 'inputs': ['>(out_pnacl_newlib_x86_32_nexe)',
185 '>(out_pnacl_newlib_x86_64_nexe)'],
186 'outputs': ['>(nmf_pnacl)'],
189 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
191 '--output=>(nmf_pnacl)',
196 ['disable_pnacl==0 and target_arch=="arm"', {
198 'build_pnacl_newlib': 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:pnacl_irt_shim',
207 'action_name': 'Generate PNACL NEWLIB NMF',
208 'inputs': ['>(out_pnacl_newlib_arm_nexe)'],
209 'outputs': ['>(nmf_pnacl)'],
212 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
214 '--output=>(nmf_pnacl)',