summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-28 12:01:29 +0000
committerthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-28 12:01:29 +0000
commit4de39f87c85a89046e2bbead1ddd4d6c85e1278c (patch)
tree41c862a438f14947f760c92edc9a70d0aa7215ce /build
parentfb3e985829bde90a71134801d773ad8e1407dda1 (diff)
downloadchromium_src-4de39f87c85a89046e2bbead1ddd4d6c85e1278c.zip
chromium_src-4de39f87c85a89046e2bbead1ddd4d6c85e1278c.tar.gz
chromium_src-4de39f87c85a89046e2bbead1ddd4d6c85e1278c.tar.bz2
Standardize grit invokes
- Add two gypi files to src/build for the boilerplate added to targets and actions - Update grit_info to also support the -E flag so it can share more of the grit build commandline - switch over all but the webkit and webkit glue grd files to use the common support BUG=22247 TEST=everything still localized correctly Review URL: http://codereview.chromium.org/6705030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/common.gypi10
-rw-r--r--build/grit_action.gypi39
-rw-r--r--build/grit_target.gypi29
3 files changed, 74 insertions, 4 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 644c9ed..b911258 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -494,13 +494,15 @@
'use_gconf%': 1,
}],
- # Setup -D flags passed into grit.
+ # Set up -D and -E flags passed into grit.
['branding=="Chrome"', {
# TODO(mmoss) The .grd files look for _google_chrome, but for
# consistency they should look for google_chrome_build like C++.
- 'grit_defines': ['-D', '_google_chrome'],
+ 'grit_defines': ['-D', '_google_chrome',
+ '-E', 'CHROMIUM_BUILD=google_chrome'],
}, {
- 'grit_defines': ['-D', '_chromium'],
+ 'grit_defines': ['-D', '_chromium',
+ '-E', 'CHROMIUM_BUILD=chromium'],
}],
['chromeos==1', {
'grit_defines': ['-D', 'chromeos'],
@@ -1529,7 +1531,7 @@
'psapi.lib',
'dbghelp.lib',
],
- 'conditions': [
+ 'conditions': [
['msvs_express', {
# Explicitly required when using the ATL with express
'AdditionalDependencies': [
diff --git a/build/grit_action.gypi b/build/grit_action.gypi
new file mode 100644
index 0000000..041d704
--- /dev/null
+++ b/build/grit_action.gypi
@@ -0,0 +1,39 @@
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This file is meant to be included into an action to invoke grit in a
+# consistent manner. To use this the following variables need to be
+# defined:
+# grit_grd_file: string: grd file path
+# grit_out_dir: string: the output directory path
+
+# It would be really nice to do this with a rule instead of actions, but it
+# would need to determine inputs and outputs via grit_info on a per-file
+# basis. GYP rules don’t currently support that. They could be extended to
+# do this, but then every generator would need to be updated to handle this.
+
+{
+ 'variables': {
+ 'grit_info_cmd': ['python', '<(DEPTH)/tools/grit/grit_info.py',
+ '<@(grit_defines)'],
+ 'grit_cmd': ['python', '<(DEPTH)/tools/grit/grit.py'],
+ },
+ 'inputs': [
+ '<!@(<(grit_info_cmd) --inputs <(grit_grd_file))',
+ ],
+ 'outputs': [
+ '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(grit_grd_file))',
+ ],
+ 'action': ['<@(grit_cmd)',
+ '-i', '<(grit_grd_file)', 'build',
+ '-o', '<(grit_out_dir)',
+ '<@(grit_defines)' ],
+ 'message': 'Generating resources from <(grit_grd_file)',
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/build/grit_target.gypi b/build/grit_target.gypi
new file mode 100644
index 0000000..c8998e1
--- /dev/null
+++ b/build/grit_target.gypi
@@ -0,0 +1,29 @@
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This file is meant to be included into a target that will have one or more
+# uses of grit_action.gypi. To use this the following variables need to be
+# defined:
+# grit_out_dir: string: the output directory path
+
+# NOTE: This file is optional, not all targets that use grit include it, some
+# do their own custom directives instead.
+{
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '<(grit_out_dir)',
+ ],
+ },
+ 'conditions': [
+ ['OS=="win"', {
+ 'dependencies': ['<(DEPTH)/build/win/system.gyp:cygwin'],
+ }],
+ ],
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2: