build_gn.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Ales Pergl <[email protected]>
  3. Date: Thu, 20 Sep 2018 17:44:29 -0700
  4. Subject: build_gn.patch
  5. These are variables we add to the root BUILDCONFIG so that they're available
  6. everywhere, without having to import("//electron/.../flags.gni").
  7. Additionally, we add the `:mas_build` config to every compiled file so that
  8. the `MAS_BUILD` #define is available everywhere. This produces fewer patch
  9. conflicts when upgrading than it would if we added a specific config dependency
  10. only to those targets which had MAS_BUILD-relevant content in them. The
  11. tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will
  12. rebuild the entire tree.
  13. diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
  14. index 725894d05274355be4ad5d6ac3388a489220a50c..e568780d699a9ac977e509165b2e9b0516cde779 100644
  15. --- a/build/config/BUILDCONFIG.gn
  16. +++ b/build/config/BUILDCONFIG.gn
  17. @@ -123,6 +123,9 @@ if (current_os == "") {
  18. # even if the value is overridden, which is wasteful. See first bullet.
  19. declare_args() {
  20. + is_electron_build = false
  21. + is_mas_build = false
  22. +
  23. # Set to enable the official build level of optimization. This has nothing
  24. # to do with branding, but enables an additional level of optimization above
  25. # release (!is_debug). This might be better expressed as a tri-state
  26. @@ -337,6 +340,7 @@ default_compiler_configs = [
  27. "//build/config/compiler/pgo:default_pgo_flags",
  28. "//build/config/coverage:default_coverage",
  29. "//build/config/sanitizers:default_sanitizer_flags",
  30. + "//electron/build/config:mas_build",
  31. ]
  32. if (is_win) {