summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 00:16:37 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 00:16:37 +0000
commitc29a3f2a810c7d113e444555ba6ba34f870d37fe (patch)
tree77ce85bdd413f13f60462ec1f899b01c5501c53e
parent0d4b67fb35fdcd99d866b77dc4ab8aa5acb92938 (diff)
downloadchromium_src-c29a3f2a810c7d113e444555ba6ba34f870d37fe.zip
chromium_src-c29a3f2a810c7d113e444555ba6ba34f870d37fe.tar.gz
chromium_src-c29a3f2a810c7d113e444555ba6ba34f870d37fe.tar.bz2
Fix branded resource buiding.
One visible change: new tab page has Google icon, not Chromium. Gyp doesn't have a set environment variable facility; hence the addition of a command line option to grit. Review URL: http://codereview.chromium.org/113974 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17148 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/chrome.gyp6
-rw-r--r--tools/grit/grit/tool/build.py10
2 files changed, 13 insertions, 3 deletions
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 3be3449..44e0c30 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -70,8 +70,10 @@
# consistency they should look for GOOGLE_CHROME_BUILD like C++.
# Clean this up when Windows moves to gyp.
'chrome_build': '_google_chrome',
+ 'branded_env': 'CHROMIUM_BUILD=google_chrome',
}, { # else: branding!="Chrome"
'chrome_build': '_chromium',
+ 'branded_env': 'CHROMIUM_BUILD=chromium',
}],
],
},
@@ -84,7 +86,9 @@
],
'action': ['python', '<@(_inputs)', '-i', '<(RULE_INPUT_PATH)',
'build', '-o', '<(SHARED_INTERMEDIATE_DIR)/chrome',
- '-D', '<(chrome_build)'],
+ '-D', '<(chrome_build)',
+ '-E', '<(branded_env)',
+ ],
'message': 'Generating resources from <(RULE_INPUT_PATH)',
},
],
diff --git a/tools/grit/grit/tool/build.py b/tools/grit/grit/tool/build.py
index daabaf8..affe699 100644
--- a/tools/grit/grit/tool/build.py
+++ b/tools/grit/grit/tool/build.py
@@ -54,6 +54,9 @@ Options:
value VAL (defaults to 1) which will be used to control
conditional inclusion of resources.
+ -E NAME=VALUE Set environment variable NAME to VALUE (within grit).
+
+
Conditional inclusion of resources only affects the output of files which
control which resources get linked into a binary, e.g. it affects .rc files
meant for compilation but it does not affect resource header files (that define
@@ -66,13 +69,17 @@ are exported to translation interchange files (e.g. XMB files), etc.
def Run(self, opts, args):
self.output_directory = '.'
- (own_opts, args) = getopt.getopt(args, 'o:D:')
+ (own_opts, args) = getopt.getopt(args, 'o:D:E:')
for (key, val) in own_opts:
if key == '-o':
self.output_directory = val
elif key == '-D':
name, val = ParseDefine(val)
self.defines[name] = val
+ elif key == '-E':
+ (env_name, env_value) = val.split('=')
+ os.environ[env_name] = env_value
+
if len(args):
print "This tool takes no tool-specific arguments."
return 2
@@ -224,4 +231,3 @@ are exported to translation interchange files (e.g. XMB files), etc.
print warnings
if self.res.UberClique().HasMissingTranslations():
sys.exit(-1)
-