summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-17 06:17:04 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-17 06:17:04 +0000
commite752af9e037d9dcf409190505ab904aee672b7aa (patch)
tree0a7e05af6437951001bb5302ff42e3b256393d4d
parent3bd77d47b5653209dfe032396e07953019e65c1e (diff)
downloadchromium_src-e752af9e037d9dcf409190505ab904aee672b7aa.zip
chromium_src-e752af9e037d9dcf409190505ab904aee672b7aa.tar.gz
chromium_src-e752af9e037d9dcf409190505ab904aee672b7aa.tar.bz2
Run GRIT on all platforms.
* RCFLAGS may not exist in SCons environment. Use empty list if absent. * Accumulate generated files in grit_files and run RES on win32 only. Patch by Seo Sanghyeon <sanxiyn@gmail.com> originally from http://codereview.chromium.org/7247/show Review URL: http://codereview.chromium.org/7614 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3517 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/SConscript54
-rw-r--r--tools/grit/grit/scons.py2
2 files changed, 29 insertions, 27 deletions
diff --git a/chrome/SConscript b/chrome/SConscript
index d333d5e..9b00f21 100644
--- a/chrome/SConscript
+++ b/chrome/SConscript
@@ -11,6 +11,7 @@ env_test = env.Clone()
env = env.Clone()
install_targets = []
+grit_files = []
env.Prepend(
@@ -208,39 +209,40 @@ if env_dll['PLATFORM'] == 'win32':
else:
targets = ['chrome']
-# TODO(port)
-if env_dll['PLATFORM'] == 'win32':
- dll_targets = env_dll.ChromeSharedLibrary(targets,
- dll_resources + input_files + libs)
- install_targets.extend(dll_targets)
- # TODO(sgk): make a pseudo-Builder for these
- import os
- import sys
- sys.path.append(Dir('#/../tools/grit').abspath)
- env_grd = env.Clone()
- env_grd.Tool('scons', toolpath=['#/../tools/grit/grit'])
+# TODO(sgk): make a pseudo-Builder for these
+import sys
+sys.path.append(Dir('#/../tools/grit').abspath)
+
+env_grd = env.Clone()
+env_grd.Tool('scons', toolpath=['#/../tools/grit/grit'])
+
+# NOTE: fake target gets replaced with real targets from reading .grd
+generated = env_grd.GRIT('app/resources/fake_generated_target',
+ '#/../chrome/app/generated_resources.grd')
+grit_files.extend(generated)
- # NOTE: fake target gets replaced with real targets from reading .grd
- generated = env_grd.GRIT('app/resources/fake_generated_target',
- '#/../chrome/app/generated_resources.grd')
- for g in [ g for g in generated if str(g).endswith('.rc') ]:
- env_res.RES(g)
+# NOTE: fake target gets replaced with real targets from reading .grd
+chromium = env_grd.GRIT('app/resources/fake_chromium_target',
+ '#/../chrome/app/chromium_strings.grd')
+grit_files.extend(chromium)
- # NOTE: fake target gets replaced with real targets from reading .grd
- chromium = env_grd.GRIT('app/resources/fake_chromium_target',
- '#/../chrome/app/chromium_strings.grd')
- for g in [ g for g in chromium if str(g).endswith('.rc') ]:
- env_res.RES(g)
+# NOTE: fake target gets replaced with real targets from reading .grd
+google_chrome = env_grd.GRIT('app/resources/fake_google_chrome_target',
+ '#/../chrome/app/google_chrome_strings.grd')
+grit_files.extend(google_chrome)
- # NOTE: fake target gets replaced with real targets from reading .grd
- google_chrome = env_grd.GRIT('app/resources/fake_google_chrome_target',
- '#/../chrome/app/google_chrome_strings.grd')
- for g in [ g for g in google_chrome if str(g).endswith('.rc') ]:
- env_res.RES(g)
+# TODO(port)
+if env_dll['PLATFORM'] == 'win32':
+ dll_targets = env_dll.ChromeSharedLibrary(targets,
+ dll_resources + input_files + libs)
+ install_targets.extend(dll_targets)
+
+ for g in [ g for g in grit_files if str(g).endswith('.rc') ]:
+ env_res.RES(g)
def chrome_version_emitter(target, source, env):
source.append('$CHROME_SRC_DIR/VERSION')
diff --git a/tools/grit/grit/scons.py b/tools/grit/grit/scons.py
index feea8f5..12516b0 100644
--- a/tools/grit/grit/scons.py
+++ b/tools/grit/grit/scons.py
@@ -41,7 +41,7 @@ def _Builder(target, source, env):
builder = build.RcBuilder()
# Get the CPP defines from the environment.
- for flag in env['RCFLAGS']:
+ for flag in env.get('RCFLAGS', []):
if flag.startswith('/D'):
flag = flag[2:]
name, val = build.ParseDefine(flag)