Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66697 - trunk/tools/build/v2/build
From: ghost_at_[hidden]
Date: 2010-11-23 02:16:31


Author: vladimir_prus
Date: 2010-11-23 02:16:28 EST (Tue, 23 Nov 2010)
New Revision: 66697
URL: http://svn.boost.org/trac/boost/changeset/66697

Log:
Implement negative conditional requirements.
For example: <threading>!single:<library>pthread

Text files modified:
   trunk/tools/build/v2/build/property.jam | 42 +++++++++++++++++++++++++++++++++++++--
   1 files changed, 39 insertions(+), 3 deletions(-)

Modified: trunk/tools/build/v2/build/property.jam
==============================================================================
--- trunk/tools/build/v2/build/property.jam (original)
+++ trunk/tools/build/v2/build/property.jam 2010-11-23 02:16:28 EST (Tue, 23 Nov 2010)
@@ -112,12 +112,48 @@
         # Separate condition and property.
         local s = [ MATCH (.*):(<.*) : $(p) ] ;
         # Split condition into individual properties.
- local c = [ regex.split $(s[1]) "," ] ;
+ local condition = [ regex.split $(s[1]) "," ] ;
         # Evaluate condition.
- if $(c) in $(context)
+ if ! [ MATCH (!).* : $(condition:G=) ]
         {
- result += $(s[2]) ;
+ # Only positive checks
+ if $(condition) in $(context)
+ {
+ result += $(s[2]) ;
+ }
         }
+ else
+ {
+ # Have negative checks
+ local fail ;
+ while $(condition)
+ {
+ local c = $(condition[1]) ;
+ local m = [ MATCH !(.*) : $(c) ] ;
+ if $(m)
+ {
+ local p = $(m:G=$(c:G)) ;
+ if $(p) in $(context)
+ {
+ fail = true ;
+ c = ;
+ }
+ }
+ else
+ {
+ if ! $(c) in $(context)
+ {
+ fail = true ;
+ c = ;
+ }
+ }
+ condition = $(condition[2-]) ;
+ }
+ if ! $(fail)
+ {
+ result += $(s[2]) ;
+ }
+ }
     }
     return $(result) ;
 }


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