summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorbratell@opera.com <bratell@opera.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 21:52:49 +0000
committerbratell@opera.com <bratell@opera.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 21:52:49 +0000
commitdd0ef2ff9d1c8e8002bd34483186c48aeec67de0 (patch)
tree64fb390d345ca90cfedffdb85480ee9fc6ecc0b5 /build
parentf0469511a47aeb119f2d7bf45d49d5eb836333ce (diff)
downloadchromium_src-dd0ef2ff9d1c8e8002bd34483186c48aeec67de0.zip
chromium_src-dd0ef2ff9d1c8e8002bd34483186c48aeec67de0.tar.gz
chromium_src-dd0ef2ff9d1c8e8002bd34483186c48aeec67de0.tar.bz2
gyp performance: don't invoke python to check dir existance
We spend a few tenths of a second every gyp invocation starting the dir_exists.py program. Seems a bit unnecessary. BUG=362075 R=scottmg@chromium.org Review URL: https://codereview.chromium.org/234963003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/common.gypi8
-rwxr-xr-xbuild/dir_exists.py10
2 files changed, 13 insertions, 5 deletions
diff --git a/build/common.gypi b/build/common.gypi
index e64e436..f3f3e94 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1316,8 +1316,8 @@
# Contains data about the attached devices for gyp_managed_install.
'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
- 'sas_dll_exists': '<!(python <(DEPTH)/build/dir_exists.py "<(sas_dll_path)")',
- 'wix_exists': '<!(python <(DEPTH)/build/dir_exists.py "<(wix_path)")',
+ 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
+ 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
@@ -1419,12 +1419,12 @@
}, {
'gcc_version%': 0,
}],
- ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
+ ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
'windows_sdk_path%': '<(windows_sdk_default_path)',
}, {
'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
}],
- ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(directx_sdk_default_path))"=="True"', {
+ ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
'directx_sdk_path%': '<(directx_sdk_default_path)',
}, {
'directx_sdk_path%': '$(DXSDK_DIR)',
diff --git a/build/dir_exists.py b/build/dir_exists.py
index 0a89bc8..70d367e 100755
--- a/build/dir_exists.py
+++ b/build/dir_exists.py
@@ -8,8 +8,16 @@ import os.path
import sys
def main():
- sys.stdout.write(str(os.path.isdir(sys.argv[1])))
+ sys.stdout.write(_is_dir(sys.argv[1]))
return 0
+def _is_dir(dir_name):
+ return str(os.path.isdir(dir_name))
+
+def DoMain(args):
+ """Hook to be called from gyp without starting a separate python
+ interpreter."""
+ return _is_dir(args[0])
+
if __name__ == '__main__':
sys.exit(main())