summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-12-23 12:14:50 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-12-23 12:14:50 (GMT)
commitf288c20f0b47ab986c9511df2295b79b2b96c9ab (patch)
tree086c1773e0e1100c929afaeed6730aa8d986c468
parent308ff634379e73a0c8668ffb0593d23f95b4dfa5 (diff)
downloadswift-f288c20f0b47ab986c9511df2295b79b2b96c9ab.zip
swift-f288c20f0b47ab986c9511df2295b79b2b96c9ab.tar.bz2
Added a 'max_jobs' build option.
-rw-r--r--SConstruct5
1 files changed, 5 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 28414f0..28bd4a9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -14,6 +14,7 @@ vars.Add(BoolVariable("optimize", "Compile with optimizations turned on", "no"))
vars.Add(BoolVariable("debug", "Compile with debug information", "yes" if os.name != "nt" else "no"))
vars.Add(BoolVariable("warnings", "Compile with warnings turned on",
"yes" if os.name != "nt" else "no"))
+vars.Add(BoolVariable("max_jobs", "Build with maximum number of parallel jobs", "no"))
if os.name != "nt" :
vars.Add(BoolVariable("coverage", "Compile with coverage information", "no"))
if os.name == "posix" :
@@ -53,6 +54,10 @@ def SConscript(*arguments, **keywords) :
if not keywords.get("test_only", False) or env["TEST"] :
return apply(oldSConscript, arguments, keywords)
+# Max out the number of jobs
+if env["max_jobs"] :
+ import multiprocessing
+ SetOption("num_jobs", multiprocessing.cpu_count())
# Default compiler flags
env["CCFLAGS"] = env.get("ccflags", [])