diff options
Diffstat (limited to 'utils/common/deploy.py')
-rwxr-xr-x | utils/common/deploy.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/utils/common/deploy.py b/utils/common/deploy.py index fd1dcb4125..5d66072a4b 100755 --- a/utils/common/deploy.py +++ b/utils/common/deploy.py | |||
@@ -59,6 +59,13 @@ except ImportError: | |||
59 | print "Fatal: This script requires the which package to run." | 59 | print "Fatal: This script requires the which package to run." |
60 | print " See http://code.google.com/p/which/." | 60 | print " See http://code.google.com/p/which/." |
61 | sys.exit(-5) | 61 | sys.exit(-5) |
62 | cpus = 1 | ||
63 | try: | ||
64 | import multiprocessing | ||
65 | cpus = multiprocessing.cpu_count() | ||
66 | print "Info: %s cores found." % cpus | ||
67 | except ImportError: | ||
68 | print "Warning: multiprocessing module not found. Assuming 1 core." | ||
62 | 69 | ||
63 | # == Global stuff == | 70 | # == Global stuff == |
64 | # Windows nees some special treatment. Differentiate between program name | 71 | # Windows nees some special treatment. Differentiate between program name |
@@ -223,7 +230,11 @@ def qmake(qmake="qmake", projfile=project, wd=".", static=True): | |||
223 | def build(wd="."): | 230 | def build(wd="."): |
224 | # make | 231 | # make |
225 | print "Building ..." | 232 | print "Building ..." |
226 | output = subprocess.Popen([make], stdout=subprocess.PIPE, cwd=wd) | 233 | command = [make] |
234 | if cpus > 1: | ||
235 | command.append("-j") | ||
236 | command.append(str(cpus)) | ||
237 | output = subprocess.Popen(command, stdout=subprocess.PIPE, cwd=wd) | ||
227 | while True: | 238 | while True: |
228 | c = output.stdout.readline() | 239 | c = output.stdout.readline() |
229 | sys.stdout.write(".") | 240 | sys.stdout.write(".") |