.gn 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. # This file is used by the GN meta build system to find the root of the source
  2. # tree and to set startup options. For documentation on the values set in this
  3. # file, run "gn help dotfile" at the command line.
  4. import("//build/dotfile_settings.gni")
  5. import("//third_party/angle/dotfile_settings.gni")
  6. # The location of the build configuration file.
  7. buildconfig = "//build/config/BUILDCONFIG.gn"
  8. # The python interpreter to use by default. On Windows, this will look
  9. # for python3.exe and python3.bat.
  10. script_executable = "python3"
  11. # These arguments override the default values for items in a declare_args
  12. # block. "gn args" in turn can override these.
  13. #
  14. # In general the value for a build arg in the declare_args block should be the
  15. # default. In some cases, a DEPS-ed in project will want different defaults for
  16. # being built as part of Chrome vs. being built standalone. In this case, the
  17. # Chrome defaults should go here. There should be no overrides here for
  18. # values declared in the main Chrome repository.
  19. #
  20. # Important note for defining defaults: This file is executed before the
  21. # BUILDCONFIG.gn file. That file sets up the global variables like "is_ios".
  22. # This means that the default_args can not depend on the platform,
  23. # architecture, or other build parameters. If you really need that, the other
  24. # repo should define a flag that toggles on a behavior that implements the
  25. # additional logic required by Chrome to set the variables.
  26. default_args = {
  27. # TODO(brettw) bug 684096: Chrome on iOS does not build v8, so "gn gen" prints
  28. # a warning that "Build argument has no effect". When adding a v8 variable, it
  29. # also needs to be defined to src/ios/BUILD.gn (respectively removed from both
  30. # location when it is removed).
  31. v8_enable_gdbjit = false
  32. v8_imminent_deprecation_warnings = false
  33. # Don't include webrtc's builtin task queue implementation.
  34. rtc_link_task_queue_impl = false
  35. # When building with Chromium, `webrtc::Location` is replaced by
  36. # `base::Location`. Since WebRTC doesn't use `public_deps` (webrtc:8603), it
  37. # would fail to propagate the dependency internally. Instead WebRTC let its
  38. # embedders to define it globally for all of its targets.
  39. rtc_common_public_deps = [ "//base" ]
  40. # Don't include the iLBC audio codec.
  41. # TODO(bugs.webrtc.org/8396): Once WebRTC gets rid of its internal
  42. # deps on codecs, we can remove this.
  43. rtc_include_ilbc = false
  44. # Changes some setup for the Crashpad build to set them to build against
  45. # Chromium's zlib, base, etc.
  46. crashpad_dependencies = "chromium"
  47. # Override ANGLE's Vulkan dependencies.
  48. angle_vulkan_headers_dir = "//third_party/vulkan-headers/src"
  49. angle_vulkan_loader_dir = "//third_party/vulkan-loader/src"
  50. angle_vulkan_tools_dir = "//third_party/vulkan-tools/src"
  51. angle_vulkan_validation_layers_dir =
  52. "//third_party/vulkan-validation-layers/src"
  53. # Override VMA's Vulkan dependencies.
  54. vma_vulkan_headers_dir = "//third_party/vulkan-headers/src"
  55. # Overwrite default args declared in the Fuchsia sdk
  56. fuchsia_sdk_readelf_exec =
  57. "//third_party/llvm-build/Release+Asserts/bin/llvm-readelf"
  58. # Overwrite default args declared in the pdfium library
  59. pdf_partition_alloc_dir = "//base/allocator/partition_allocator"
  60. devtools_visibility = [ "*" ]
  61. clang_unsafe_buffers_paths = "//build/config/unsafe_buffers_paths.txt"
  62. }
  63. # These are the targets to skip header checking by default. The files in targets
  64. # matching these patterns (see "gn help label_pattern" for format) will not have
  65. # their includes checked for proper dependencies when you run either
  66. # "gn check" or "gn gen --check".
  67. no_check_targets = [
  68. # //v8, https://crbug.com/v8/7330
  69. "//v8/src/inspector:inspector", # 20 errors
  70. "//v8/test/cctest:cctest_sources", # 15 errors
  71. "//v8/test/unittests:inspector_unittests_sources", # 2 errors
  72. "//v8:cppgc_base", # 1 error
  73. "//v8:v8_internal_headers", # 11 errors
  74. "//v8:v8_libplatform", # 2 errors
  75. ]
  76. # These are the list of GN files that run exec_script. This allowlist exists
  77. # to force additional review for new uses of exec_script, which is strongly
  78. # discouraged.
  79. #
  80. # PLEASE READ
  81. #
  82. # You should almost never need to add new exec_script calls. exec_script is
  83. # slow, especially on Windows, and can cause confusing effects. Although
  84. # individually each call isn't slow or necessarily very confusing, at the scale
  85. # of our repo things get out of hand quickly. By strongly pushing back on all
  86. # additions, we keep the build fast and clean. If you think you need to add a
  87. # new call, please consider:
  88. #
  89. # - Do not use a script to check for the existence of a file or directory to
  90. # enable a different mode. Instead, use GN build args to enable or disable
  91. # functionality and set options. An example is checking for a file in the
  92. # src-internal repo to see if the corresponding src-internal feature should
  93. # be enabled. There are several things that can go wrong with this:
  94. #
  95. # - It's mysterious what causes some things to happen. Although in many cases
  96. # such behavior can be conveniently automatic, GN optimizes for explicit
  97. # and obvious behavior so people can more easily diagnose problems.
  98. #
  99. # - The user can't enable a mode for one build and not another. With GN build
  100. # args, the user can choose the exact configuration of multiple builds
  101. # using one checkout. But implicitly basing flags on the state of the
  102. # checkout, this functionality is broken.
  103. #
  104. # - It's easy to get stale files. If for example the user edits the gclient
  105. # to stop checking out src-internal (or any other optional thing), it's
  106. # easy to end up with stale files still mysteriously triggering build
  107. # conditions that are no longer appropriate (yes, this happens in real
  108. # life).
  109. #
  110. # - Do not use a script to iterate files in a directory (glob):
  111. #
  112. # - This has the same "stale file" problem as the above discussion. Various
  113. # operations can leave untracked files in the source tree which can cause
  114. # surprising effects.
  115. #
  116. # - It becomes impossible to use "git grep" to find where a certain file is
  117. # referenced. This operation is very common and people really do get
  118. # confused when things aren't listed.
  119. #
  120. # - It's easy to screw up. One common case is a build-time script that packs
  121. # up a directory. The author notices that the script isn't re-run when the
  122. # directory is updated, so adds a glob so all the files are listed as
  123. # inputs. This seems to work great... until a file is deleted. When a
  124. # file is deleted, all the inputs the glob lists will still be up to date
  125. # and no command-lines will have been changed. The action will not be
  126. # re-run and the build will be broken. It is possible to get this correct
  127. # using glob, and it's possible to mess it up without glob, but globs make
  128. # this situation much easier to create. if the build always lists the
  129. # files and passes them to a script, it will always be correct.
  130. exec_script_allowlist =
  131. build_dotfile_settings.exec_script_allowlist +
  132. angle_dotfile_settings.exec_script_whitelist +
  133. [
  134. # Allowlist entries for //build should go into
  135. # //build/dotfile_settings.gni instead, so that they can be shared
  136. # with other repos. The entries in this list should be only for files
  137. # in the Chromium repo outside of //build.
  138. "//build_overrides/build.gni",
  139. "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn",
  140. "//chrome/version.gni",
  141. # TODO(dgn): Layer violation but breaks the build otherwise, see
  142. # https://crbug.com/474506.
  143. "//clank/java/BUILD.gn",
  144. "//clank/native/BUILD.gn",
  145. "//google_apis/BUILD.gn",
  146. "//printing/BUILD.gn",
  147. "//remoting/host/installer/linux/BUILD.gn",
  148. "//remoting/remoting_version.gni",
  149. "//remoting/host/installer/win/generate_clsids.gni",
  150. "//tools/grit/grit_rule.gni",
  151. "//tools/gritsettings/BUILD.gn",
  152. ]