[email protected] | 0c678ce | 2014-02-27 00:46:11 | [diff] [blame] | 1 | # Copyright 2014 The Chromium Authors. All rights reserved. |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 2 | # 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] | ee82fab | 2012-09-24 22:14:34 | [diff] [blame] | 20 | 'nso_target': 'libppapi_cpp.so', |
[email protected] | 4223f8d | 2012-06-07 01:10:06 | [diff] [blame] | 21 | 'build_glibc': 1, |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 22 | 'build_newlib': 1, |
[email protected] | f7c2871 | 2013-01-24 23:11:33 | [diff] [blame] | 23 | 'build_pnacl_newlib': 1, |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 24 | 'sources': [ |
[email protected] | 7091950 | 2011-12-16 02:30:03 | [diff] [blame] | 25 | '<@(cpp_source_files)', |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 26 | '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] | ff92200c | 2012-09-10 21:58:16 | [diff] [blame] | 35 | 'target_name': 'ppapi_gles2_lib', |
| 36 | 'type': 'none', |
| 37 | 'variables': { |
| 38 | 'nlib_target': 'libppapi_gles2.a', |
[email protected] | ee82fab | 2012-09-24 22:14:34 | [diff] [blame] | 39 | 'nso_target': 'libppapi_gles2.so', |
[email protected] | ff92200c | 2012-09-10 21:58:16 | [diff] [blame] | 40 | 'build_glibc': 1, |
| 41 | 'build_newlib': 1, |
[email protected] | f7c2871 | 2013-01-24 23:11:33 | [diff] [blame] | 42 | 'build_pnacl_newlib': 1, |
[email protected] | ff92200c | 2012-09-10 21:58:16 | [diff] [blame] | 43 | '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] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 57 | 'target_name': 'ppapi_nacl_tests', |
| 58 | 'type': 'none', |
| 59 | 'dependencies': [ |
ncbray | 731b352 | 2014-09-05 08:06:20 | [diff] [blame^] | 60 | '<(DEPTH)/native_client/tools.gyp:prep_toolchain', |
[email protected] | ee82fab | 2012-09-24 22:14:34 | [diff] [blame] | 61 | '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib', |
ncbray | 731b352 | 2014-09-05 08:06:20 | [diff] [blame^] | 62 | '<(DEPTH)/native_client/src/untrusted/pthread/pthread.gyp:pthread_lib', |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 63 | 'ppapi_cpp_lib', |
| 64 | 'native_client/native_client.gyp:ppapi_lib', |
[email protected] | 3b74078c | 2012-08-03 01:01:52 | [diff] [blame] | 65 | ], |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 66 | 'variables': { |
[email protected] | 03b3212 | 2013-04-05 07:19:47 | [diff] [blame] | 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=': [], |
[email protected] | 3b74078c | 2012-08-03 01:01:52 | [diff] [blame] | 70 | # TODO(bradnelson): Remove this compile flag once new nacl_rev is |
| 71 | # above 9362. |
| 72 | 'compile_flags': [ |
| 73 | '-DGL_GLEXT_PROTOTYPES', |
| 74 | ], |
[email protected] | a070d168 | 2013-03-27 07:40:56 | [diff] [blame] | 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. |
[email protected] | 3c74cf48 | 2014-05-28 03:00:42 | [diff] [blame] | 79 | 'compile_flags!': [ |
[email protected] | a070d168 | 2013-03-27 07:40:56 | [diff] [blame] | 80 | '-g', |
| 81 | ], |
[email protected] | 3b74078c | 2012-08-03 01:01:52 | [diff] [blame] | 82 | 'defines': [ |
| 83 | 'GL_GLEXT_PROTOTYPES', |
| 84 | ], |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 85 | 'nexe_target': 'ppapi_nacl_tests', |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 86 | 'build_newlib': 1, |
| 87 | 'include_dirs': [ |
| 88 | 'lib/gl/include', |
| 89 | '..', |
| 90 | ], |
| 91 | 'link_flags': [ |
| 92 | '-lppapi_cpp', |
| 93 | '-lppapi', |
[email protected] | ad854a8ca | 2012-11-19 22:20:29 | [diff] [blame] | 94 | '-pthread', |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 95 | ], |
[email protected] | a070d168 | 2013-03-27 07:40:56 | [diff] [blame] | 96 | 'link_flags!': [ |
| 97 | '-O3', |
| 98 | ], |
| 99 | 'translate_flags': [ |
| 100 | '-O0', |
| 101 | ], |
[email protected] | c5707ee | 2013-08-04 06:32:21 | [diff] [blame] | 102 | 'conditions': [ |
[email protected] | a991263 | 2014-02-20 23:34:10 | [diff] [blame] | 103 | ['target_arch=="ia32" or target_arch=="x64"', { |
[email protected] | c5707ee | 2013-08-04 06:32:21 | [diff] [blame] | 104 | 'extra_deps_newlib64': [ |
| 105 | '>(tc_lib_dir_newlib64)/libppapi_cpp.a', |
| 106 | '>(tc_lib_dir_newlib64)/libppapi.a', |
| 107 | ], |
| 108 | 'extra_deps_newlib32': [ |
| 109 | '>(tc_lib_dir_newlib32)/libppapi_cpp.a', |
| 110 | '>(tc_lib_dir_newlib32)/libppapi.a', |
| 111 | ], |
| 112 | 'extra_deps_glibc64': [ |
| 113 | '>(tc_lib_dir_glibc64)/libppapi_cpp.so', |
| 114 | '>(tc_lib_dir_glibc64)/libppapi.so', |
| 115 | ], |
| 116 | 'extra_deps_glibc32': [ |
| 117 | '>(tc_lib_dir_glibc32)/libppapi_cpp.so', |
| 118 | '>(tc_lib_dir_glibc32)/libppapi.so', |
| 119 | ], |
| 120 | }], |
| 121 | ['target_arch=="arm"', { |
| 122 | 'extra_deps_arm': [ |
| 123 | '>(tc_lib_dir_newlib_arm)/libppapi_cpp.a', |
| 124 | '>(tc_lib_dir_newlib_arm)/libppapi.a', |
| 125 | ], |
| 126 | }], |
[email protected] | ebd08aa | 2012-05-22 19:54:38 | [diff] [blame] | 127 | ], |
[email protected] | c5707ee | 2013-08-04 06:32:21 | [diff] [blame] | 128 | 'extra_deps_pnacl_newlib': [ |
| 129 | '>(tc_lib_dir_pnacl_newlib)/libppapi_cpp.a', |
| 130 | '>(tc_lib_dir_pnacl_newlib)/libppapi.a', |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 131 | ], |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 132 | 'sources': [ |
[email protected] | 7091950 | 2011-12-16 02:30:03 | [diff] [blame] | 133 | '<@(test_common_source_files)', |
| 134 | '<@(test_nacl_source_files)', |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 135 | ], |
[email protected] | 8eca7f0 | 2013-01-26 06:06:31 | [diff] [blame] | 136 | 'extra_args': [ |
| 137 | '--strip-all', |
| 138 | ], |
[email protected] | ea43be4 | 2013-12-17 01:33:39 | [diff] [blame] | 139 | 'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py', |
[email protected] | 3c74cf48 | 2014-05-28 03:00:42 | [diff] [blame] | 140 | 'create_nonsfi_test_nmf': 'tests/create_nonsfi_test_nmf.py', |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 141 | }, |
[email protected] | 4223f8d | 2012-06-07 01:10:06 | [diff] [blame] | 142 | 'conditions': [ |
[email protected] | a991263 | 2014-02-20 23:34:10 | [diff] [blame] | 143 | ['target_arch!="arm" and target_arch!="mipsel" and disable_glibc==0', { |
[email protected] | 4223f8d | 2012-06-07 01:10:06 | [diff] [blame] | 144 | 'variables': { |
| 145 | 'build_glibc': 1, |
| 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', |
| 152 | }, |
| 153 | 'actions': [ |
| 154 | { |
| 155 | 'action_name': 'Generate GLIBC NMF and copy libs', |
[email protected] | ea43be4 | 2013-12-17 01:33:39 | [diff] [blame] | 156 | # NOTE: create_nmf must be first, it is the script python executes |
| 157 | # below. |
| 158 | 'inputs': ['>(create_nmf)', '>(out_glibc64)', '>(out_glibc32)'], |
[email protected] | 4223f8d | 2012-06-07 01:10:06 | [diff] [blame] | 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)'], |
| 163 | 'action': [ |
| 164 | 'python', |
[email protected] | 4223f8d | 2012-06-07 01:10:06 | [diff] [blame] | 165 | '>@(_inputs)', |
| 166 | '--objdump=>(nacl_objdump)', |
| 167 | '--library-path=>(libdir_glibc64)', |
| 168 | '--library-path=>(libdir_glibc32)', |
[email protected] | c5707ee | 2013-08-04 06:32:21 | [diff] [blame] | 169 | '--library-path=>(tc_lib_dir_glibc32)', |
| 170 | '--library-path=>(tc_lib_dir_glibc64)', |
[email protected] | 4223f8d | 2012-06-07 01:10:06 | [diff] [blame] | 171 | '--output=>(nmf_glibc)', |
| 172 | '--stage-dependencies=<(PRODUCT_DIR)', |
| 173 | ], |
| 174 | }, |
| 175 | ], |
| 176 | }], |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 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, |
[email protected] | 17d0f50c | 2014-04-07 17:51:04 | [diff] [blame] | 182 | # ARM on ARM platforms, or MIPS on MIPS platforms, not all |
| 183 | # versions always. |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 184 | # The same goes for the PNaCl shims. So, we have two variations here. |
[email protected] | a991263 | 2014-02-20 23:34:10 | [diff] [blame] | 185 | ['disable_pnacl==0 and (target_arch=="ia32" or target_arch=="x64")', { |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 186 | 'variables': { |
| 187 | 'build_pnacl_newlib': 1, |
[email protected] | 4c94cae | 2014-07-29 03:03:12 | [diff] [blame] | 188 | 'translate_pexe_with_build': 1, |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 189 | 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf', |
| 190 | }, |
| 191 | # Shim is a dependency for the nexe because we pre-translate. |
| 192 | 'dependencies': [ |
[email protected] | e2cda3251 | 2014-07-16 15:51:46 | [diff] [blame] | 193 | '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot', |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 194 | ], |
[email protected] | 2c8a509 | 2014-04-03 12:01:49 | [diff] [blame] | 195 | 'actions': [ |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 196 | { |
| 197 | 'action_name': 'Generate PNACL NEWLIB NMF', |
[email protected] | ea43be4 | 2013-12-17 01:33:39 | [diff] [blame] | 198 | # NOTE: create_nmf must be first, it is the script python executes |
| 199 | # below. |
| 200 | 'inputs': [ |
| 201 | '>(create_nmf)', |
| 202 | '>(out_pnacl_newlib_x86_32_nexe)', |
| 203 | '>(out_pnacl_newlib_x86_64_nexe)' |
| 204 | ], |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 205 | 'outputs': ['>(nmf_pnacl)'], |
| 206 | 'action': [ |
| 207 | 'python', |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 208 | '>@(_inputs)', |
| 209 | '--output=>(nmf_pnacl)', |
| 210 | ], |
| 211 | }, |
| 212 | ], |
| 213 | }], |
[email protected] | 2c8a509 | 2014-04-03 12:01:49 | [diff] [blame] | 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. |
| 217 | 'variables': { |
| 218 | 'enable_x86_32_nonsfi': 1, |
[email protected] | 4c94cae | 2014-07-29 03:03:12 | [diff] [blame] | 219 | 'translate_pexe_with_build': 1, |
[email protected] | 3c74cf48 | 2014-05-28 03:00:42 | [diff] [blame] | 220 | 'nmf_nonsfi%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_nonsfi.nmf', |
[email protected] | 2c8a509 | 2014-04-03 12:01:49 | [diff] [blame] | 221 | }, |
[email protected] | 4c94cae | 2014-07-29 03:03:12 | [diff] [blame] | 222 | # Shim is a dependency for the nexe because we pre-translate. |
| 223 | 'dependencies': [ |
| 224 | '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot', |
| 225 | ], |
[email protected] | 3c74cf48 | 2014-05-28 03:00:42 | [diff] [blame] | 226 | 'actions': [ |
| 227 | { |
| 228 | 'action_name': 'Generate PNACL NEWLIB NONSFI NMF', |
| 229 | 'inputs': ['>(create_nonsfi_test_nmf)'], |
| 230 | 'outputs': ['>(nmf_nonsfi)'], |
| 231 | 'action': [ |
| 232 | 'python', |
| 233 | '>(create_nonsfi_test_nmf)', |
| 234 | '--output=>(nmf_nonsfi)', |
| 235 | '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)', |
| 236 | ], |
| 237 | }, |
| 238 | ], |
[email protected] | 2c8a509 | 2014-04-03 12:01:49 | [diff] [blame] | 239 | }], |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 240 | ['disable_pnacl==0 and target_arch=="arm"', { |
| 241 | 'variables': { |
| 242 | 'build_pnacl_newlib': 1, |
[email protected] | 4c94cae | 2014-07-29 03:03:12 | [diff] [blame] | 243 | 'translate_pexe_with_build': 1, |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 244 | 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf', |
| 245 | }, |
| 246 | # Shim is a dependency for the nexe because we pre-translate. |
| 247 | 'dependencies': [ |
[email protected] | e2cda3251 | 2014-07-16 15:51:46 | [diff] [blame] | 248 | '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot', |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 249 | ], |
| 250 | 'actions': [ |
| 251 | { |
| 252 | 'action_name': 'Generate PNACL NEWLIB NMF', |
[email protected] | ea43be4 | 2013-12-17 01:33:39 | [diff] [blame] | 253 | # NOTE: create_nmf must be first, it is the script python executes |
| 254 | # below. |
| 255 | 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_arm_nexe)'], |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 256 | 'outputs': ['>(nmf_pnacl)'], |
| 257 | 'action': [ |
| 258 | 'python', |
[email protected] | 1e40ba00 | 2013-03-07 22:07:33 | [diff] [blame] | 259 | '>@(_inputs)', |
| 260 | '--output=>(nmf_pnacl)', |
| 261 | ], |
| 262 | }, |
| 263 | ], |
| 264 | }], |
[email protected] | 17d0f50c | 2014-04-07 17:51:04 | [diff] [blame] | 265 | ['disable_pnacl==0 and target_arch=="mipsel"', { |
| 266 | 'variables': { |
| 267 | 'build_pnacl_newlib': 1, |
[email protected] | 4c94cae | 2014-07-29 03:03:12 | [diff] [blame] | 268 | 'translate_pexe_with_build': 1, |
[email protected] | 17d0f50c | 2014-04-07 17:51:04 | [diff] [blame] | 269 | 'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf', |
| 270 | }, |
| 271 | # Shim is a dependency for the nexe because we pre-translate. |
| 272 | 'dependencies': [ |
[email protected] | e2cda3251 | 2014-07-16 15:51:46 | [diff] [blame] | 273 | '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot', |
[email protected] | 17d0f50c | 2014-04-07 17:51:04 | [diff] [blame] | 274 | ], |
| 275 | 'actions': [ |
| 276 | { |
| 277 | 'action_name': 'Generate PNACL NEWLIB NMF', |
| 278 | 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib_mips_nexe)'], |
| 279 | 'outputs': ['>(nmf_pnacl)'], |
| 280 | 'action': [ |
| 281 | 'python', |
| 282 | '>@(_inputs)', |
| 283 | '--output=>(nmf_pnacl)', |
| 284 | ], |
| 285 | }, |
| 286 | ], |
| 287 | }], |
[email protected] | 4223f8d | 2012-06-07 01:10:06 | [diff] [blame] | 288 | ], |
[email protected] | 1f081e7a | 2011-12-01 19:33:21 | [diff] [blame] | 289 | }, |
| 290 | ], |
| 291 | } |