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