OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 assert(!is_android || enable_plugins, | 5 assert(!is_android || enable_plugins, |
6 "//ppapi should not be referenced when is_android && !enable_plugins") | 6 "//ppapi should not be referenced when is_android && !enable_plugins") |
7 | 7 |
8 copy("copy_test_files") { | 8 copy("copy_test_files") { |
9 visibility = [ ":*" ] | 9 visibility = [ ":*" ] |
10 sources = [ | 10 sources = [ |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 "lib/gl/gles2/gles2.c", | 186 "lib/gl/gles2/gles2.c", |
187 ] | 187 ] |
188 deps = [ | 188 deps = [ |
189 "//ppapi/cpp", | 189 "//ppapi/cpp", |
190 ] | 190 ] |
191 } | 191 } |
192 | 192 |
193 if (enable_nacl) { | 193 if (enable_nacl) { |
194 if (is_nacl) { | 194 if (is_nacl) { |
195 shared_library("ppapi_cpp_lib_shared") { | 195 shared_library("ppapi_cpp_lib_shared") { |
| 196 output_name = "libppapi_cpp" |
| 197 |
196 # When using gcc, we hide all symbols by default, but that breaks at | 198 # When using gcc, we hide all symbols by default, but that breaks at |
197 # link time as the test executable requires symbols defined in the | 199 # link time as the test executable requires symbols defined in the |
198 # shared library. | 200 # shared library. |
199 if (is_nacl_glibc) { | 201 if (is_nacl_glibc) { |
200 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | 202 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] |
201 } | 203 } |
202 | 204 |
203 sources = ppapi_sources.cpp_source_files | 205 sources = ppapi_sources.cpp_source_files |
204 sources += [ | 206 sources += [ |
205 "cpp/module_embedder.h", | 207 "cpp/module_embedder.h", |
206 "cpp/ppp_entrypoints.cc", | 208 "cpp/ppp_entrypoints.cc", |
207 ] | 209 ] |
208 cflags = [ "-fPIC" ] | 210 cflags = [ "-fPIC" ] |
209 deps = [ | 211 deps = [ |
210 "//build/config/nacl:nacl_base", | 212 "//build/config/nacl:nacl_base", |
211 ] | 213 ] |
212 } | 214 } |
213 | 215 |
214 executable("ppapi_nacl_tests") { | 216 executable("ppapi_nacl_tests_nexe") { |
| 217 output_name = "ppapi_nacl_tests" |
215 include_dirs = [ "lib/gl/include" ] | 218 include_dirs = [ "lib/gl/include" ] |
216 sources = ppapi_sources.test_common_source_files + | 219 sources = ppapi_sources.test_common_source_files + |
217 ppapi_sources.test_nacl_source_files | 220 ppapi_sources.test_nacl_source_files |
218 defines = [ | 221 defines = [ |
219 "GL_GLEXT_PROTOTYPES", | 222 "GL_GLEXT_PROTOTYPES", |
220 "PPAPI_TEST_IMPLEMENTATION", | 223 "PPAPI_TEST_IMPLEMENTATION", |
221 ] | 224 ] |
222 ldflags = [ "-pthread" ] | 225 ldflags = [ "-pthread" ] |
223 deps = [ | 226 deps = [ |
224 "//build/config/nacl:nacl_base", | 227 "//build/config/nacl:nacl_base", |
225 "//ppapi/native_client:ppapi_lib", | 228 "//ppapi/native_client:ppapi_lib", |
226 ] | 229 ] |
227 if (is_nacl_glibc) { | 230 if (is_nacl_glibc) { |
228 deps += [ ":ppapi_cpp_lib_shared" ] | 231 deps += [ ":ppapi_cpp_lib_shared" ] |
229 } else { | 232 } else { |
230 deps += [ ":ppapi_cpp_lib" ] | 233 deps += [ ":ppapi_cpp_lib" ] |
231 } | 234 } |
232 } | 235 } |
233 | 236 |
234 if (current_cpu == "pnacl") { | 237 if (current_cpu == "pnacl") { |
235 action("translate_pexe_to_nexe") { | 238 action("translate_pexe_to_nexe") { |
236 # We specify the toolchain explicitly because in the Non-SFI case, we | 239 # We specify the toolchain explicitly because in the Non-SFI case, we |
237 # still want to use the pexe built using the newlib_pnacl toolchain. | 240 # still want to use the pexe built using the newlib_pnacl toolchain. |
238 tests = ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl)" | 241 tests = ":ppapi_nacl_tests_nexe(//build/toolchain/nacl:newlib_pnacl)" |
239 | 242 |
240 pexe = get_label_info(tests, "root_out_dir") + "/ppapi_nacl_tests.pexe" | 243 pexe = get_label_info(tests, "root_out_dir") + "/ppapi_nacl_tests.pexe" |
241 nexe = "${root_out_dir}/ppapi_nacl_tests.nexe" | 244 nexe = "${root_out_dir}/ppapi_nacl_tests.nexe" |
242 | 245 |
243 script = "${nacl_toolchain_bindir}/pydir/loader.py" | 246 script = "${nacl_toolchain_bindir}/pydir/loader.py" |
244 sources = [ | 247 sources = [ |
245 pexe, | 248 pexe, |
246 ] | 249 ] |
247 outputs = [ | 250 outputs = [ |
248 nexe, | 251 nexe, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 ] | 291 ] |
289 deps = [ | 292 deps = [ |
290 tests, | 293 tests, |
291 ] | 294 ] |
292 data_deps = [ | 295 data_deps = [ |
293 pnacl_irt_shim, | 296 pnacl_irt_shim, |
294 ] | 297 ] |
295 } | 298 } |
296 } | 299 } |
297 | 300 |
298 copy("nacl_tests_copy") { | 301 copy("ppapi_nacl_tests_copy") { |
299 sources = [ | 302 sources = [ |
300 "${root_out_dir}/ppapi_nacl_tests.nexe", | 303 "${root_out_dir}/ppapi_nacl_tests.nexe", |
301 ] | 304 ] |
302 | 305 |
303 # The CPU names used in tests/ppapi_nacl_tests_newlib.nmf | 306 # The CPU names used in tests/ppapi_nacl_tests_newlib.nmf |
304 # are the ones used in GYP (x32 for x86). | 307 # are the ones used in GYP (x32 for x86). |
| 308 if (target_cpu == "x86" || |
| 309 (is_nacl_nonsfi && (target_cpu == "x86" || target_cpu == "x64"))) { |
| 310 nmf_cpu = "x32" |
| 311 } else { |
| 312 nmf_cpu = target_cpu |
| 313 } |
305 if (current_cpu == "pnacl") { | 314 if (current_cpu == "pnacl") { |
306 suffix = "pnacl" | 315 if (is_nacl_nonsfi) { |
| 316 suffix = "pnacl_newlib_${nmf_cpu}_nonsfi" |
| 317 } else { |
| 318 suffix = "pnacl_newlib_${nmf_cpu}" |
| 319 } |
| 320 } else if (is_nacl_glibc) { |
| 321 suffix = "glibc_${nmf_cpu}" |
307 } else { | 322 } else { |
308 if (target_cpu == "x86") { | 323 suffix = "newlib_${nmf_cpu}" |
309 nmf_cpu = "x32" | |
310 } else { | |
311 nmf_cpu = target_cpu | |
312 } | |
313 if (is_nacl_glibc) { | |
314 suffix = "glibc_${nmf_cpu}" | |
315 } else { | |
316 suffix = "newlib_${nmf_cpu}" | |
317 } | |
318 } | 324 } |
319 outputs = [ | 325 outputs = [ |
320 "${root_build_dir}/{{source_name_part}}_${suffix}.nexe", | 326 "${root_build_dir}/{{source_name_part}}_${suffix}.nexe", |
321 ] | 327 ] |
322 if (current_cpu == "pnacl") { | 328 if (current_cpu == "pnacl") { |
323 deps = [ | 329 deps = [ |
324 ":translate_pexe_to_nexe", | 330 ":translate_pexe_to_nexe", |
325 ] | 331 ] |
326 } else { | 332 } else { |
327 deps = [ | 333 deps = [ |
328 ":ppapi_nacl_tests", | 334 ":ppapi_nacl_tests_nexe", |
329 ] | 335 ] |
330 } | 336 } |
331 } | 337 } |
332 | 338 |
333 generate_nmf("ppapi_nacl_tests_nmf") { | 339 if (is_nacl_nonsfi) { |
334 if (is_nacl_glibc) { | 340 generate_nonsfi_test_nmf("ppapi_nacl_tests_nmf") { |
335 nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" | 341 nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl_nonsfi.nmf" |
336 stage_dependencies = root_build_dir | 342 files = get_target_outputs(":ppapi_nacl_tests_copy") |
337 } else if (current_cpu == "pnacl") { | 343 executable = files[0] |
338 nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl.nmf" | 344 deps = [ |
339 } else { | 345 ":ppapi_nacl_tests_copy", |
340 nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" | 346 ] |
341 } | 347 } |
342 executables = get_target_outputs(":nacl_tests_copy") | 348 } else { |
343 deps = [ | 349 generate_nmf("ppapi_nacl_tests_nmf") { |
344 ":nacl_tests_copy", | 350 if (is_nacl_glibc) { |
345 ] | 351 nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" |
| 352 stage_dependencies = root_build_dir |
| 353 } else if (current_cpu == "pnacl") { |
| 354 nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl.nmf" |
| 355 } else { |
| 356 nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" |
| 357 } |
| 358 executables = get_target_outputs(":ppapi_nacl_tests_copy") |
| 359 deps = [ |
| 360 ":ppapi_nacl_tests_copy", |
| 361 ] |
| 362 } |
346 } | 363 } |
347 | 364 |
348 generate_nonsfi_test_nmf("ppapi_nacl_tests_pnacl_nonsfi_nmf") { | 365 group("ppapi_nacl_tests") { |
349 nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl_nonsfi.nmf" | 366 data_deps = [ |
350 executable = "${root_out_dir}/ppapi_nacl_tests.nexe" | 367 ":ppapi_nacl_tests_copy", |
351 deps = [ | 368 ":ppapi_nacl_tests_nmf", |
352 ":translate_pexe_to_nexe", | |
353 ] | 369 ] |
354 } | 370 } |
355 } | 371 } |
356 | 372 |
357 group("ppapi_nacl_tests_all") { | 373 group("ppapi_nacl_tests_all") { |
358 data_deps = [ | 374 data_deps = [ |
359 ":copy_test_files", | 375 ":copy_test_files", |
360 ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", | 376 ":ppapi_nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})
", |
361 ":ppapi_nacl_tests_nmf(//build/toolchain/nacl:glibc_${target_cpu})", | 377 ":ppapi_nacl_tests(//build/toolchain/nacl:glibc_${target_cpu})", |
362 ] | 378 ] |
363 if (enable_pnacl) { | 379 if (enable_pnacl) { |
364 data_deps += [ | 380 data_deps += [ |
365 ":ppapi_nacl_tests_nmf(//build/toolchain/nacl:newlib_pnacl)", | 381 ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl)", |
366 ":ppapi_nacl_tests_pnacl_nonsfi_nmf(//build/toolchain/nacl:newlib_pnacl_
nonsfi)", | 382 ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl_nonsfi)", |
367 ] | 383 ] |
368 } | 384 } |
369 } | 385 } |
370 } | 386 } |
OLD | NEW |