aboutsummaryrefslogtreecommitdiff
path: root/BUILD.gn
diff options
context:
space:
mode:
authorCalder Kitagawa <ckitagawa@google.com>2018-05-08 15:08:31 +0000
committerEdward Lesmes <ehmaldonado@google.com>2021-07-23 22:32:44 +0000
commitf1724ddc48fd67154e33f1cfdb1bd8338213753a (patch)
tree6fe506f573267043fb5ca87cbf91ce126c94a340 /BUILD.gn
parentfd9b41c873bbb0a4bc62297291c43a4355466c90 (diff)
downloadzucchini-f1724ddc48fd67154e33f1cfdb1bd8338213753a.tar.gz
[Zucchini] Buildflag control of architectures
Allows Zucchini to be built with only a subset of architectures enabled this saves on binary size at the cost of flexibility. The idea is that only the desired architectures would be compiled for a particular usecases. For example the Windows setup.exe only needs Windows support. Expected savings as a percent of total binary size at present (868.5 kB non-debug): - Remove DEX 3.13% (841.3 kB) - Remove Win 6.00% (816.4 kB) - Only Raw 9.13% (789.2 kB) Note that in the case of Raw saving could be made significantly higher by entirely removing the dependence on references and reference projection. However, at present the additional messiness of the additional buildflags all over the codebase is not worth the maintenance costs. Bug: 835007 Change-Id: I091cb9d76e8473340374be1a33a5df48137a3067 Reviewed-on: https://chromium-review.googlesource.com/1037922 Commit-Queue: Calder Kitagawa <ckitagawa@google.com> Reviewed-by: Greg Thompson <grt@chromium.org> Reviewed-by: Samuel Huang <huangs@chromium.org> Cr-Commit-Position: refs/heads/master@{#556802} NOKEYCHECK=True GitOrigin-RevId: f0545bf20576afb65f9bbc493ea9b4d5d42c4738
Diffstat (limited to 'BUILD.gn')
-rw-r--r--BUILD.gn14
1 files changed, 14 insertions, 0 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 800216e..f36c949 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -2,9 +2,22 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/buildflag_header.gni")
import("//chrome/process_version_rc_template.gni")
import("//testing/test.gni")
+buildflag_header("buildflags") {
+ header = "buildflags.h"
+
+ # Disable DEX on Windows Official Builds.
+ _enable_dex = !(is_win && is_official_build)
+ _enable_win = true
+ flags = [
+ "ENABLE_DEX=$_enable_dex",
+ "ENABLE_WIN=$_enable_win",
+ ]
+}
+
static_library("zucchini_lib") {
sources = [
"abs32_utils.cc",
@@ -79,6 +92,7 @@ static_library("zucchini_lib") {
]
deps = [
+ ":buildflags",
"//base",
]
}