viz.gni 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright 2016 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//gpu/vulkan/features.gni")
  5. import("//skia/features.gni")
  6. import("//testing/test.gni")
  7. # Fuchsia doesn't support GL rendering so there is no need to run tests for
  8. # that code path.
  9. enable_gl_backend_tests = !is_fuchsia
  10. # TODO(samans): Support more configurations.
  11. # CFI issue: https://crbug.com/967819
  12. # Fuchsia ARM64 https://crbug.com/1058247
  13. enable_vulkan_backend_tests =
  14. enable_vulkan &&
  15. ((is_linux && !is_castos && !is_cfi) || (is_fuchsia && target_cpu == "x64"))
  16. enable_dawn_backend_tests = skia_use_dawn && enable_skia_dawn_gtests
  17. # TODO(crbug.com/1336055): Determine whether is_cast_android needs this.
  18. enable_cast_overlay_strategy = is_castos || is_cast_android
  19. viz_remove_configs = []
  20. viz_add_configs = [ "//build/config:precompiled_headers" ]
  21. if (!is_debug) {
  22. viz_remove_configs += [ "//build/config/compiler:default_optimization" ]
  23. viz_add_configs += [ "//build/config/compiler:optimize_max" ]
  24. }
  25. template("viz_source_set") {
  26. source_set(target_name) {
  27. forward_variables_from(invoker, "*", [ "configs" ])
  28. if (defined(invoker.configs)) {
  29. configs += invoker.configs
  30. }
  31. configs -= viz_remove_configs
  32. configs += viz_add_configs
  33. }
  34. }
  35. template("viz_component") {
  36. component(target_name) {
  37. forward_variables_from(invoker, "*", [ "configs" ])
  38. if (defined(invoker.configs)) {
  39. configs += invoker.configs
  40. }
  41. configs -= viz_remove_configs
  42. configs += viz_add_configs
  43. }
  44. }
  45. template("viz_static_library") {
  46. static_library(target_name) {
  47. forward_variables_from(invoker, "*", [ "configs" ])
  48. if (defined(invoker.configs)) {
  49. configs += invoker.configs
  50. }
  51. configs -= viz_remove_configs
  52. configs += viz_add_configs
  53. }
  54. }
  55. template("viz_test") {
  56. test(target_name) {
  57. forward_variables_from(invoker, "*", [ "configs" ])
  58. if (defined(invoker.configs)) {
  59. configs += invoker.configs
  60. }
  61. configs -= viz_remove_configs
  62. configs += viz_add_configs
  63. }
  64. }