From c29a3f2a810c7d113e444555ba6ba34f870d37fe Mon Sep 17 00:00:00 2001 From: "jrg@chromium.org" Date: Fri, 29 May 2009 00:16:37 +0000 Subject: 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 --- tools/grit/grit/tool/build.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools') 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) - -- cgit v1.1