diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-11 09:48:51 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-11 09:48:51 +0000 |
commit | 3122b64aa6096e6536751a9b91204038b41fde5b (patch) | |
tree | a635cec354a69e016a5ad3b164992b0e6394a786 /chrome/chrome.gyp | |
parent | 4babc955f54652a632806eb056804eb59d1f77d0 (diff) | |
download | chromium_src-3122b64aa6096e6536751a9b91204038b41fde5b.zip chromium_src-3122b64aa6096e6536751a9b91204038b41fde5b.tar.gz chromium_src-3122b64aa6096e6536751a9b91204038b41fde5b.tar.bz2 |
Factor out the resource generation actions for Linux and FreeBSD.
Create a new target 'packed_resources' that can be used for building
resource files for Linux and FreeBSD, without building the chrome
binary.
The new target is useful for test programs that depend on the
resource files. For example, view_examples on Linux depends on
chrome.pak to be present in the product directory. Hence we
needed to build "chrome" before "view_examples" just for
resource files, which is not great.
Note that I tried to unify the actions with Mac, but failed
as Mac needs to build the mac bundle as part of chrome_dll
library.
TEST=try --clobber; locally clean-built chrome on linux.
BUG=29969
Review URL: http://codereview.chromium.org/486006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34339 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/chrome.gyp')
-rwxr-xr-x | chrome/chrome.gyp | 161 |
1 files changed, 89 insertions, 72 deletions
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 730ff1a..8272579 100755 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -973,6 +973,7 @@ '<@(chromium_dependencies)', # Needed for chrome_dll_main.cc #include of gtk/gtk.h '../build/linux/system.gyp:gtk', + 'packed_resources', ], 'sources': [ 'app/chrome_dll_main.cc', @@ -981,8 +982,7 @@ 'copies': [ { 'destination': '<(PRODUCT_DIR)', - 'files': ['<(INTERMEDIATE_DIR)/repack/chrome.pak', - 'tools/build/linux/chrome-wrapper', + 'files': ['tools/build/linux/chrome-wrapper', '../third_party/xdg-utils/scripts/xdg-settings', ], # The wrapper script above may need to generate a .desktop file, @@ -995,12 +995,6 @@ }], ], }, - { - 'destination': '<(PRODUCT_DIR)/locales', - 'files': [ - '>!@(<(repack_locales_cmd) -o -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))', - ], - }, ], }], ['OS=="linux" and (toolkit_views==1 or chromeos==1)', { @@ -1345,70 +1339,6 @@ 'app/client_util.cc', ] }], - ['OS=="linux" or OS=="freebsd"', { - 'variables': { - 'repack_path': '../tools/data_pack/repack.py', - }, - 'actions': [ - # TODO(mark): These actions are duplicated for the Mac in the - # chrome_dll target. Can they be unified? - { - 'action_name': 'repack_chrome', - 'variables': { - 'pak_inputs': [ - '<(grit_out_dir)/browser_resources.pak', - '<(grit_out_dir)/common_resources.pak', - '<(grit_out_dir)/renderer_resources.pak', - '<(grit_out_dir)/theme_resources.pak', - '<(SHARED_INTERMEDIATE_DIR)/app/app_resources/app_resources.pak', - '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak', - '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak', - ], - }, - 'inputs': [ - '<(repack_path)', - '<@(pak_inputs)', - ], - 'outputs': [ - '<(INTERMEDIATE_DIR)/repack/chrome.pak', - ], - 'action': ['python', '<(repack_path)', '<@(_outputs)', - '<@(pak_inputs)'], - }, - { - 'action_name': 'repack_locales', - 'variables': { - 'conditions': [ - ['branding=="Chrome"', { - 'branding_flag': ['-b', 'google_chrome',], - }, { # else: branding!="Chrome" - 'branding_flag': ['-b', 'chromium',], - }], - ], - }, - 'inputs': [ - 'tools/build/repack_locales.py', - # NOTE: Ideally the common command args would be shared amongst - # inputs/outputs/action, but the args include shell variables - # which need to be passed intact, and command expansion wants - # to expand the shell variables. Adding the explicit quoting - # here was the only way it seemed to work. - '>!@(<(repack_locales_cmd) -i <(branding_flag) -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))', - ], - 'outputs': [ - '>!@(<(repack_locales_cmd) -o -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))', - ], - 'action': [ - '<@(repack_locales_cmd)', - '<@(branding_flag)', - '-g', '<(grit_out_dir)', - '-s', '<(SHARED_INTERMEDIATE_DIR)', - '-x', '<(INTERMEDIATE_DIR)', - '<@(locales)', - ], - }, - ], - }], ], }, { @@ -2687,6 +2617,93 @@ }, ]}, # 'targets' ], # OS=="win" + ['OS=="linux" or OS=="freebsd"', { + 'targets': [{ + 'target_name': 'packed_resources', + 'type': 'none', + 'variables': { + 'repack_path': '../tools/data_pack/repack.py', + }, + 'actions': [ + # TODO(mark): These actions are duplicated for the Mac in the + # chrome_dll target. Can they be unified? + # + # Mac needs 'process_outputs_as_mac_bundle_resources' to be set, + # and the option is only effective when the target type is native + # binary. Hence we cannot build the Mac bundle resources here. + { + 'action_name': 'repack_chrome', + 'variables': { + 'pak_inputs': [ + '<(grit_out_dir)/browser_resources.pak', + '<(grit_out_dir)/common_resources.pak', + '<(grit_out_dir)/renderer_resources.pak', + '<(grit_out_dir)/theme_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/app/app_resources/app_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak', + ], + }, + 'inputs': [ + '<(repack_path)', + '<@(pak_inputs)', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/repack/chrome.pak', + ], + 'action': ['python', '<(repack_path)', '<@(_outputs)', + '<@(pak_inputs)'], + }, + { + 'action_name': 'repack_locales', + 'variables': { + 'conditions': [ + ['branding=="Chrome"', { + 'branding_flag': ['-b', 'google_chrome',], + }, { # else: branding!="Chrome" + 'branding_flag': ['-b', 'chromium',], + }], + ], + }, + 'inputs': [ + 'tools/build/repack_locales.py', + # NOTE: Ideally the common command args would be shared amongst + # inputs/outputs/action, but the args include shell variables + # which need to be passed intact, and command expansion wants + # to expand the shell variables. Adding the explicit quoting + # here was the only way it seemed to work. + '>!@(<(repack_locales_cmd) -i <(branding_flag) -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))', + ], + 'outputs': [ + '>!@(<(repack_locales_cmd) -o -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))', + ], + 'action': [ + '<@(repack_locales_cmd)', + '<@(branding_flag)', + '-g', '<(grit_out_dir)', + '-s', '<(SHARED_INTERMEDIATE_DIR)', + '-x', '<(INTERMEDIATE_DIR)', + '<@(locales)', + ], + }, + ], + # We'll install the resource files to the product directory. + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/locales', + 'files': [ + '>!@(<(repack_locales_cmd) -o -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))', + ], + }, + { + 'destination': '<(PRODUCT_DIR)', + 'files': [ + '<(INTERMEDIATE_DIR)/repack/chrome.pak' + ], + }, + ], + }], # targets + }], # OS=="linux" or OS=="freebsd" ], # 'conditions' } |