summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorbratell@opera.com <bratell@opera.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-06 09:56:44 +0000
committerbratell@opera.com <bratell@opera.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-06 09:56:44 +0000
commitd2f38924e42a91f762e5cebe5cba1f952c5cefbb (patch)
treed0fabd334674ea00e25c409045603915611cbf13 /build
parentcef7931c5fe4b0b084dbf6ad5971cdca436a1e8f (diff)
downloadchromium_src-d2f38924e42a91f762e5cebe5cba1f952c5cefbb.zip
chromium_src-d2f38924e42a91f762e5cebe5cba1f952c5cefbb.tar.gz
chromium_src-d2f38924e42a91f762e5cebe5cba1f952c5cefbb.tar.bz2
gyp performance: Load detect_host_arch directly.
We ran "python detect_host_arch.py" ~15 times from gyp. Run detect_host_arch.py directly from from within gyp for faster execution and since the path is no longer part of the command, the result will also be cached more often. The total gain is at best 0.3 seconds. For most people it will be less. BUG=362075 Review URL: https://codereview.chromium.org/256303003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/common.gypi2
-rwxr-xr-xbuild/detect_host_arch.py (renamed from build/linux/detect_host_arch.py)9
2 files changed, 8 insertions, 3 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 5a2753f..73c2a44 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -41,7 +41,7 @@
['OS=="win" or OS=="mac" or OS=="ios"', {
'host_arch%': 'ia32',
}, {
- 'host_arch%': '<!(python <(DEPTH)/build/linux/detect_host_arch.py)',
+ 'host_arch%': '<!pymod_do_main(detect_host_arch)',
}],
],
},
diff --git a/build/linux/detect_host_arch.py b/build/detect_host_arch.py
index 2686461..638dd68 100755
--- a/build/linux/detect_host_arch.py
+++ b/build/detect_host_arch.py
@@ -11,6 +11,12 @@ import sys
def main():
+ print DoMain([])
+ return 0
+
+def DoMain(_):
+ """Hook to be called from gyp without starting a separate python
+ interpreter."""
host_arch = platform.machine()
# Convert machine type to format recognized by gyp.
@@ -28,8 +34,7 @@ def main():
if host_arch == 'x64' and platform.architecture()[0] == '32bit':
host_arch = 'ia32'
- print host_arch
- return 0
+ return host_arch
if __name__ == '__main__':
sys.exit(main())