Permalink
Browse files

use all available CPU cores when building

  • Loading branch information...
1 parent 6ab180e commit ee9c88075f83189acbfc506745f1ac9bc4978042 @rsms rsms committed Jul 22, 2010
Showing with 11 additions and 1 deletion.
  1. +11 −1 wscript
View
12 wscript
@@ -5,13 +5,22 @@ import os
import os.path as path
import platform
-
srcdir = "."
blddir = 'build'
VERSION = '0.0.1'
PLATFORM_IS_DARWIN = platform.platform().find('Darwin') == 0
+jobs=1
+if os.environ.has_key('JOBS'):
+ jobs = int(os.environ['JOBS'])
+else:
+ try:
+ import multiprocessing
+ jobs = multiprocessing.cpu_count()
+ except:
+ pass
+
# OS X dylib linker fix
from TaskGen import feature, after
@feature('cshlib')
@@ -53,6 +62,7 @@ def lint(ctx):
' $(find src \! -name queue.h -name *.h)')
def build(ctx):
+ Options.options.jobs = jobs
ctx.add_pre_fun(lint)
task = ctx.new_task_gen('cxx', 'shlib', 'node_addon')
task.target = 'binding'

0 comments on commit ee9c880

Please sign in to comment.