diff options
author | brettw <brettw@chromium.org> | 2015-11-26 01:21:25 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-26 09:22:27 +0000 |
commit | 06c2ba3165d8b02364bf818d5028a7cb4fe48ac0 (patch) | |
tree | d4ec179c6a5f993e36288697879d9ca52c7a45b2 /tools/grit | |
parent | bbe5890bf24f3f198ca7142b84da46f6d35c5886 (diff) | |
download | chromium_src-06c2ba3165d8b02364bf818d5028a7cb4fe48ac0.zip chromium_src-06c2ba3165d8b02364bf818d5028a7cb4fe48ac0.tar.gz chromium_src-06c2ba3165d8b02364bf818d5028a7cb4fe48ac0.tar.bz2 |
New build flag system, convert Google Now flag
This generates headers with build flags rather than forcing them all to be global. It includes an accessor wrapper so that references to the flags will fail if the proper header is not included.
Converts Google Now to use this and remove the global google now define and grit define.
Adds support for grit define values of "true" and "false" for ease of integration with GN (they are mapped to the corresponding Python "True" and "False").
Adds dependencies from the main gyp targets to the new generated feature define target. Since GYP only does hard dependencies one level, this should reduce the chance that somebody adds more of these cases and forces to add a dependency.
Reland of https://codereview.chromium.org/1475513006/
Reland of https://codereview.chromium.org/1458653002/
TBR=mark@chromium.org
Review URL: https://codereview.chromium.org/1469383005
Cr-Commit-Position: refs/heads/master@{#361854}
Diffstat (limited to 'tools/grit')
-rwxr-xr-x | tools/grit/grit/util.py | 7 | ||||
-rw-r--r-- | tools/grit/grit_rule.gni | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/tools/grit/grit/util.py b/tools/grit/grit/util.py index b958bc2..93dce26 100755 --- a/tools/grit/grit/util.py +++ b/tools/grit/grit/util.py @@ -483,7 +483,8 @@ def ParseDefine(define): '''Parses a define argument and returns the name and value. The format is either "NAME=VAL" or "NAME", using True as the default value. - Values of "1" and "0" are transformed to True and False respectively. + Values of "1"/"true" and "0"/"false" are transformed to True and False + respectively. Args: define: a string of the form "NAME=VAL" or "NAME". @@ -497,8 +498,8 @@ def ParseDefine(define): val = True if len(parts) > 1: val = parts[1] - if val == "1": val = True - elif val == "0": val = False + if val == "1" or val == "true": val = True + elif val == "0" or val == "false": val = False return (name, val) diff --git a/tools/grit/grit_rule.gni b/tools/grit/grit_rule.gni index 083e3d9..f60d8fa 100644 --- a/tools/grit/grit_rule.gni +++ b/tools/grit/grit_rule.gni @@ -244,13 +244,6 @@ if (enable_settings_app) { "enable_settings_app", ] } -if (enable_google_now) { - grit_defines += [ - "-D", - "enable_google_now", - ] -} - if (enable_webrtc) { grit_defines += [ "-D", |