summaryrefslogtreecommitdiffstats
path: root/tools/grit
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-11-24 18:44:26 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-25 02:45:24 +0000
commit3118dde528359280fa0cb3c6fc5b6323e834c514 (patch)
tree59e8c87ebc2a9afeb9db467a1fe689a91978432c /tools/grit
parentb61bdf47278732dd1f73fc0d8a04a25897961b84 (diff)
downloadchromium_src-3118dde528359280fa0cb3c6fc5b6323e834c514.zip
chromium_src-3118dde528359280fa0cb3c6fc5b6323e834c514.tar.gz
chromium_src-3118dde528359280fa0cb3c6fc5b6323e834c514.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. Review URL: https://codereview.chromium.org/1458653002 Cr-Commit-Position: refs/heads/master@{#361527}
Diffstat (limited to 'tools/grit')
-rwxr-xr-xtools/grit/grit/util.py7
-rw-r--r--tools/grit/grit_rule.gni7
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",