build.gni 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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("//build/config/gclient_args.gni")
  5. # Uncomment these to specify a different NDK location and version in
  6. # non-Chromium builds.
  7. # default_android_ndk_root = "//third_party/android_ndk"
  8. # default_android_ndk_version = "r10e"
  9. # Some non-Chromium builds don't support building java targets.
  10. enable_java_templates = true
  11. # Features used by //base/trace_event and //services/tracing.
  12. declare_args() {
  13. # Tracing support requires //third_party/perfetto, which is not available in
  14. # libchrome (CrOS's version of //base). This flag can disable tracing support
  15. # altogether, in which case all tracing instrumentation in //base becomes a
  16. # no-op.
  17. # TODO(crbug/1065905): Add dependency on perfetto to support typed events.
  18. enable_base_tracing = true
  19. # Switches the TRACE_EVENT instrumentation from base's TraceLog implementation
  20. # to //third_party/perfetto's client library. Not implemented yet, currently a
  21. # no-op to set up trybot infrastructure.
  22. # TODO(crbug/1006769): Switch to perfetto's client library.
  23. use_perfetto_client_library = false
  24. # Limits the defined //third_party/android_deps targets to only "buildCompile"
  25. # and "buildCompileNoDeps" targets. This is useful for third-party
  26. # repositories which do not use JUnit tests. For instance,
  27. # limit_android_deps == true removes "gn gen" requirement for
  28. # //third_party/robolectric .
  29. limit_android_deps = false
  30. # Allows googletest to pretty-print various absl types. Disabled for nacl due
  31. # to lack of toolchain support.
  32. gtest_enable_absl_printers = !is_nacl
  33. }
  34. # Allows different projects to specify their own suppression/ignore lists for
  35. # sanitizer tools.
  36. # asan_suppressions_file = "path/to/asan_suppressions.cc"
  37. # asan_win_ignorelist_path = "path/to/asan/blocklist_win.txt"
  38. # lsan_suppressions_file = "path/to/lsan_suppressions.cc"
  39. # tsan_suppressions_file = "path/to/tsan_suppressions.cc"
  40. # tsan_ignorelist_path = "path/to/tsan/ignores.txt"
  41. # msan_ignorelist_path = "path/to/msan/ignorelist.txt"
  42. # ubsan_ignorelist_path = "path/to/ubsan/ignorelist.txt"
  43. # ubsan_vptr_ignorelist_path = "path/to/ubsan/vptr_ignorelist.txt"
  44. # ubsan_security_ignorelist_path = "path/to/ubsan/security_ignorelist.txt"
  45. # cfi_ignorelist_path = "path/to/cfi/ignores.txt"
  46. if (host_os == "mac" || is_apple) {
  47. # Needed for is_apple when targeting macOS or iOS, independent of host.
  48. # Needed for host_os=="mac" for running host tool such as gperf in blink
  49. # even when targeting e.g. Windows.
  50. # TODO(thakis): See TODO in scripts.gni -- this should really only be needed
  51. # if is_apple, independent of host_os.
  52. declare_args() {
  53. # Use the system install of Xcode for tools like ibtool, libtool, etc.
  54. # This does not affect the compiler. When this variable is false, targets
  55. # will instead use a hermetic install of Xcode. [The hermetic install can
  56. # be obtained with gclient sync after setting the environment variable
  57. # FORCE_MAC_TOOLCHAIN for target_os mac only].
  58. use_system_xcode = ""
  59. }
  60. if (use_system_xcode == "") {
  61. _result = exec_script("//build/mac/should_use_hermetic_xcode.py",
  62. [ current_os ],
  63. "value")
  64. assert(_result != 2,
  65. "Do not allow building targets with the default" +
  66. "hermetic toolchain if the minimum OS version is not met.")
  67. assert(_result != 3,
  68. "iOS does not support building with a hermetic toolchain. " +
  69. "Please install Xcode.")
  70. use_system_xcode = _result != 1
  71. }
  72. assert(current_os != "ios" || use_system_xcode)
  73. assert(host_os == "mac" || !use_system_xcode)
  74. }