From e2f25f98d1faf4a581719936b2b98e7f98e01a41 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 1 Mar 2011 15:03:37 +0100 Subject: [PATCH] parallel builds --- config/SConscript.configure | 10 +++++++++- data/windows/mitsuba.vcproj.template | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/config/SConscript.configure b/config/SConscript.configure index 239cdc70..7a23a59d 100644 --- a/config/SConscript.configure +++ b/config/SConscript.configure @@ -1,3 +1,5 @@ +import multiprocessing + Import('sys', 'os', 'SCons') AddOption("--cfg", dest="cfg", type="string", nargs=1, action='store', help='Manually specify a configuration file') @@ -7,6 +9,12 @@ if configFile == None: configFile = os.path.normpath(os.path.join(os.path.dirname(os.getcwd()), configFile)) +AddOption("--parallelize", dest="parallelize", action='store_true', help='Parallelize to the available number of cores?') +parallelize = GetOption('parallelize') + +if parallelize == True: + SetOption('num_jobs', multiprocessing.cpu_count()) + if not os.path.exists(configFile): print 'A configuration file must be selected! Have a look at \"README\"' Exit(1) @@ -84,7 +92,7 @@ if env.has_key('BASELIBDIR'): env.Decider('MD5-timestamp') #env.SetOption('num_jobs', multiprocessing.cpu_count()) -AddOption("--dist", dest="dist", type="string", nargs=0, action='store', help='Make an official release') +AddOption("--dist", dest="dist", action="store_true", help='Make an official release') # Check whether everything important is available def CheckCXX(context): diff --git a/data/windows/mitsuba.vcproj.template b/data/windows/mitsuba.vcproj.template index e03f8942..c1b1fe0d 100644 --- a/data/windows/mitsuba.vcproj.template +++ b/data/windows/mitsuba.vcproj.template @@ -27,9 +27,9 @@ >