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