Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49869 - in trunk/tools/build/v2: . build util
From: ghost_at_[hidden]
Date: 2008-11-22 05:03:12


Author: vladimir_prus
Date: 2008-11-22 05:03:10 EST (Sat, 22 Nov 2008)
New Revision: 49869
URL: http://svn.boost.org/trac/boost/changeset/49869

Log:
Add new --jobs option and allow to set it in site-config.jam/user-config.jam.

Text files modified:
   trunk/tools/build/v2/build-system.jam | 8 ++++++--
   trunk/tools/build/v2/build/project.jam | 11 +++++++++++
   trunk/tools/build/v2/util/option.jam | 10 ++++++++++
   3 files changed, 27 insertions(+), 2 deletions(-)

Modified: trunk/tools/build/v2/build-system.jam
==============================================================================
--- trunk/tools/build/v2/build-system.jam (original)
+++ trunk/tools/build/v2/build-system.jam 2008-11-22 05:03:10 EST (Sat, 22 Nov 2008)
@@ -870,7 +870,12 @@
         }
     }
 
-
+ local j = [ option.get jobs ] ;
+ if $(j)
+ {
+ modules.poke : PARALLELISM : $(j) ;
+ }
+
     # The 'all' pseudo target is not strictly needed expect in the case when we
     # use it below but people often assume they always have this target
     # available and do not declare it themselves before use which may cause
@@ -878,7 +883,6 @@
     # 'all' target.
     NOTFILE all ;
 
-
     # And now that all the actual raw Jam targets and all the dependencies
     # between them have been prepared all that is left is to tell Jam to update
     # those targets.

Modified: trunk/tools/build/v2/build/project.jam
==============================================================================
--- trunk/tools/build/v2/build/project.jam (original)
+++ trunk/tools/build/v2/build/project.jam 2008-11-22 05:03:10 EST (Sat, 22 Nov 2008)
@@ -1052,4 +1052,15 @@
             return $(condition):$(requirements) ;
         }
     }
+
+ rule option ( name : value )
+ {
+ if $(__name__) != site-config && $(__name__) != user-config
+ {
+ import errors ;
+ errors.error "The 'option' rule may be used only in site-config or user-config" ;
+ }
+ import option ;
+ option.set $(name) : $(value) ;
+ }
 }

Modified: trunk/tools/build/v2/util/option.jam
==============================================================================
--- trunk/tools/build/v2/util/option.jam (original)
+++ trunk/tools/build/v2/util/option.jam 2008-11-22 05:03:10 EST (Sat, 22 Nov 2008)
@@ -6,6 +6,12 @@
 
 import modules ;
 
+# Set a value for a named option, to be used when not overridden on the command
+# line.
+rule set ( name : value )
+{
+ .option.$(name) = $(value) ;
+}
 
 rule get ( name : default-value ? )
 {
@@ -14,6 +20,10 @@
     {
         return $(m[1]) ;
     }
+ else if $(.option.$(name))
+ {
+ return $(.option.$(name)) ;
+ }
     else
     {
         return $(default-value) ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk