Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54891 - trunk/tools/build/v2/util
From: ghost_at_[hidden]
Date: 2009-07-11 10:42:30


Author: vladimir_prus
Date: 2009-07-11 10:42:30 EDT (Sat, 11 Jul 2009)
New Revision: 54891
URL: http://svn.boost.org/trac/boost/changeset/54891

Log:
Add support for options with implied values.

Text files modified:
   trunk/tools/build/v2/util/option.jam | 26 +++++++++++++++++---------
   1 files changed, 17 insertions(+), 9 deletions(-)

Modified: trunk/tools/build/v2/util/option.jam
==============================================================================
--- trunk/tools/build/v2/util/option.jam (original)
+++ trunk/tools/build/v2/util/option.jam 2009-07-11 10:42:30 EDT (Sat, 11 Jul 2009)
@@ -13,21 +13,29 @@
     .option.$(name) = $(value) ;
 }
 
-rule get ( name : default-value ? )
+rule get ( name : default-value ? : implied-value ? )
 {
     local m = [ MATCH --$(name)=(.*) : [ modules.peek : ARGV ] ] ;
     if $(m)
     {
         return $(m[1]) ;
     }
- else if $(.option.$(name))
- {
- return $(.option.$(name)) ;
- }
- else
- {
- return $(default-value) ;
- }
+ else
+ {
+ m = [ MATCH (--$(name)) : [ modules.peek : ARGV ] ] ;
+ if $(m) && $(implied-value)
+ {
+ return $(implied-value) ;
+ }
+ 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