blob: a0b0f053f8cf17b005ad655a763a3f2c0c197897 [file] [log] [blame]
[email protected]4223f8d2012-06-07 01:10:061# Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]1f081e7a2011-12-01 19:33:212# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
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.
8
9{
10 'includes': [
11 '../native_client/build/untrusted.gypi',
12 'ppapi_sources.gypi',
13 ],
14 'targets': [
15 {
16 'target_name': 'ppapi_cpp_lib',
17 'type': 'none',
18 'variables': {
19 'nlib_target': 'libppapi_cpp.a',
[email protected]ee82fab2012-09-24 22:14:3420 'nso_target': 'libppapi_cpp.so',
[email protected]4223f8d2012-06-07 01:10:0621 'build_glibc': 1,
[email protected]1f081e7a2011-12-01 19:33:2122 'build_newlib': 1,
[email protected]f7c28712013-01-24 23:11:3323 'build_pnacl_newlib': 1,
[email protected]1f081e7a2011-12-01 19:33:2124 'sources': [
[email protected]70919502011-12-16 02:30:0325 '<@(cpp_source_files)',
[email protected]1f081e7a2011-12-01 19:33:2126 'cpp/module_embedder.h',
27 'cpp/ppp_entrypoints.cc',
28 ],
29 },
30 'dependencies': [
31 '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
32 ],
33 },
34 {
[email protected]ff92200c2012-09-10 21:58:1635 'target_name': 'ppapi_gles2_lib',
36 'type': 'none',
37 'variables': {
38 'nlib_target': 'libppapi_gles2.a',
[email protected]ee82fab2012-09-24 22:14:3439 'nso_target': 'libppapi_gles2.so',
[email protected]ff92200c2012-09-10 21:58:1640 'build_glibc': 1,
41 'build_newlib': 1,
[email protected]f7c28712013-01-24 23:11:3342 'build_pnacl_newlib': 1,
[email protected]ff92200c2012-09-10 21:58:1643 'include_dirs': [
44 'lib/gl/include',
45 ],
46 'sources': [
47 'lib/gl/gles2/gl2ext_ppapi.c',
48 'lib/gl/gles2/gl2ext_ppapi.h',
49 'lib/gl/gles2/gles2.c',
50 ],
51 },
52 'dependencies': [
53 '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
54 ],
55 },
56 {
[email protected]1f081e7a2011-12-01 19:33:2157 'target_name': 'ppapi_nacl_tests',
58 'type': 'none',
59 'dependencies': [
[email protected]ee82fab2012-09-24 22:14:3460 '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
[email protected]1f081e7a2011-12-01 19:33:2161 'ppapi_cpp_lib',
62 'native_client/native_client.gyp:ppapi_lib',
[email protected]3b74078c2012-08-03 01:01:5263 ],
[email protected]1f081e7a2011-12-01 19:33:2164 'variables': {
[email protected]3b74078c2012-08-03 01:01:5265 # TODO(bradnelson): Remove this compile flag once new nacl_rev is
66 # above 9362.
67 'compile_flags': [
68 '-DGL_GLEXT_PROTOTYPES',
69 ],
[email protected]a070d1682013-03-27 07:40:5670 # 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.
74 'compile_flags!': [
75 '-g',
76 ],
[email protected]3b74078c2012-08-03 01:01:5277 'defines': [
78 'GL_GLEXT_PROTOTYPES',
79 ],
[email protected]1f081e7a2011-12-01 19:33:2180 'nexe_target': 'ppapi_nacl_tests',
[email protected]1f081e7a2011-12-01 19:33:2181 'build_newlib': 1,
82 'include_dirs': [
83 'lib/gl/include',
84 '..',
85 ],
86 'link_flags': [
87 '-lppapi_cpp',
88 '-lppapi',
[email protected]ad854a8ca2012-11-19 22:20:2989 '-pthread',
[email protected]1f081e7a2011-12-01 19:33:2190 ],
[email protected]a070d1682013-03-27 07:40:5691 'link_flags!': [
92 '-O3',
93 ],
94 'translate_flags': [
95 '-O0',
96 ],
[email protected]ebd08aa2012-05-22 19:54:3897 # TODO(bradchen): get rid of extra_deps64 and extra_deps32
98 # once native_client/build/untrusted.gypi no longer needs them.
[email protected]ebd08aa2012-05-22 19:54:3899 'extra_deps_newlib64': [
100 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi_cpp.a',
101 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi.a',
102 ],
103 'extra_deps_newlib32': [
104 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi_cpp.a',
105 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi.a',
106 ],
107 'extra_deps_glibc64': [
[email protected]e816cc52012-11-22 03:15:06108 '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libppapi_cpp.so',
109 '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libppapi.so',
[email protected]ebd08aa2012-05-22 19:54:38110 ],
111 'extra_deps_glibc32': [
[email protected]e816cc52012-11-22 03:15:06112 '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libppapi_cpp.so',
113 '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libppapi.so',
[email protected]ebd08aa2012-05-22 19:54:38114 ],
[email protected]5386cb242012-04-03 16:14:52115 'extra_deps_arm': [
116 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm/libppapi_cpp.a',
117 '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm/libppapi.a',
118 ],
[email protected]1e40ba002013-03-07 22:07:33119 'extra_deps_pnacl': [
120 '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib/libppapi_cpp.a',
121 '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib/libppapi.a',
122 ],
[email protected]1f081e7a2011-12-01 19:33:21123 'sources': [
[email protected]70919502011-12-16 02:30:03124 '<@(test_common_source_files)',
125 '<@(test_nacl_source_files)',
[email protected]1f081e7a2011-12-01 19:33:21126 ],
[email protected]8eca7f02013-01-26 06:06:31127 'extra_args': [
128 '--strip-all',
129 ],
[email protected]1f081e7a2011-12-01 19:33:21130 },
[email protected]4223f8d2012-06-07 01:10:06131 'conditions': [
[email protected]46c9a052012-06-27 19:27:26132 ['target_arch!="arm"', {
[email protected]1e40ba002013-03-07 22:07:33133 # This is user code (vs IRT code), so tls accesses do not
134 # need to be indirect through a function call.
135 # For PNaCl, the -mtls-use-call flag is localized to the
136 # IRT's translation command, so it is unnecessary to
137 # counteract that flag here.
[email protected]46c9a052012-06-27 19:27:26138 'variables': {
[email protected]1e40ba002013-03-07 22:07:33139 'gcc_compile_flags': [
[email protected]46c9a052012-06-27 19:27:26140 '-mno-tls-use-call',
[email protected]2ed9c042012-12-04 07:23:35141 ],
[email protected]46c9a052012-06-27 19:27:26142 },
143 }],
[email protected]2f7da672012-06-21 08:38:32144 ['target_arch!="arm" and disable_glibc==0', {
[email protected]4223f8d2012-06-07 01:10:06145 'variables': {
146 'build_glibc': 1,
147 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
148 # doesn't work on Windows.
149 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
150 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
151 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
152 'nmf_glibc%': '<(PRODUCT_DIR)/>(nexe_target)_glibc.nmf',
153 },
154 'actions': [
155 {
156 'action_name': 'Generate GLIBC NMF and copy libs',
157 'inputs': ['>(out_glibc64)', '>(out_glibc32)'],
158 # NOTE: There is no explicit dependency for the lib32
159 # and lib64 directories created in the PRODUCT_DIR.
160 # They are created as a side-effect of NMF creation.
161 'outputs': ['>(nmf_glibc)'],
162 'action': [
163 'python',
164 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
165 '>@(_inputs)',
166 '--objdump=>(nacl_objdump)',
167 '--library-path=>(libdir_glibc64)',
168 '--library-path=>(libdir_glibc32)',
[email protected]ee82fab2012-09-24 22:14:34169 '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32',
170 '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64',
[email protected]4223f8d2012-06-07 01:10:06171 '--output=>(nmf_glibc)',
172 '--stage-dependencies=<(PRODUCT_DIR)',
173 ],
[email protected]8801db192012-12-17 22:23:53174 'msvs_cygwin_shell': 1,
[email protected]4223f8d2012-06-07 01:10:06175 },
176 ],
177 }],
[email protected]1e40ba002013-03-07 22:07:33178 # Test PNaCl pre-translated code (pre-translated to save bot time).
179 # We only care about testing that code generation is correct,
180 # and in-browser translation is tested elsewhere.
181 # NOTE: native_client/build/untrusted.gypi dictates that
182 # PNaCl only generate x86-32 and x86-64 on x86 platforms,
183 # or ARM on ARM platforms, not all versions always.
184 # The same goes for the PNaCl shims. So, we have two variations here.
185 ['disable_pnacl==0 and target_arch!="arm"', {
186 'variables': {
187 'build_pnacl_newlib': 1,
188 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
189 },
190 # Shim is a dependency for the nexe because we pre-translate.
191 'dependencies': [
192 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
193 ],
194 'actions': [
195 {
196 'action_name': 'Generate PNACL NEWLIB NMF',
197 'inputs': ['>(out_pnacl_newlib_x86_32_nexe)',
198 '>(out_pnacl_newlib_x86_64_nexe)'],
199 'outputs': ['>(nmf_pnacl)'],
200 'action': [
201 'python',
202 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
203 '>@(_inputs)',
204 '--output=>(nmf_pnacl)',
205 ],
206 },
207 ],
208 }],
209 ['disable_pnacl==0 and target_arch=="arm"', {
210 'variables': {
211 'build_pnacl_newlib': 1,
212 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
213 },
214 # Shim is a dependency for the nexe because we pre-translate.
215 'dependencies': [
216 '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
217 ],
218 'actions': [
219 {
220 'action_name': 'Generate PNACL NEWLIB NMF',
221 'inputs': ['>(out_pnacl_newlib_arm_nexe)'],
222 'outputs': ['>(nmf_pnacl)'],
223 'action': [
224 'python',
225 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
226 '>@(_inputs)',
227 '--output=>(nmf_pnacl)',
228 ],
229 },
230 ],
231 }],
[email protected]4223f8d2012-06-07 01:10:06232 ],
[email protected]1f081e7a2011-12-01 19:33:21233 },
234 ],
235}