Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80007 - trunk/tools/build/v2/build
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-13 11:05:05


Author: jurko
Date: 2012-08-13 11:05:04 EDT (Mon, 13 Aug 2012)
New Revision: 80007
URL: http://svn.boost.org/trac/boost/changeset/80007

Log:
Improved Boost Build's error message displayed when encountering actual targets with matching names, belonging to virtual targets of which at least one does not have an assigned 'creating subvariant' (may happen when Boost Build or build script code creates a virtual-target but forgets to pass it to the virtual-target.register rule).
Text files modified:
   trunk/tools/build/v2/build/virtual-target.jam | 28 +++++++++++++++++++++++-----
   1 files changed, 23 insertions(+), 5 deletions(-)

Modified: trunk/tools/build/v2/build/virtual-target.jam
==============================================================================
--- trunk/tools/build/v2/build/virtual-target.jam (original)
+++ trunk/tools/build/v2/build/virtual-target.jam 2012-08-13 11:05:04 EDT (Mon, 13 Aug 2012)
@@ -1059,9 +1059,26 @@
     if $(.actual.$(actual-name))
     {
         local cs1 = [ $(.actual.$(actual-name)).creating-subvariant ] ;
+ local cmt1-name ;
+ if $(cs1)-is-defined
+ {
+ local cmt1 = [ $(cs1).main-target ] ;
+ cmt1-name = [ $(cmt1).full-name ] ;
+ }
         local cs2 = [ $(virtual-target).creating-subvariant ] ;
- local cmt1 = [ $(cs1).main-target ] ;
- local cmt2 = [ $(cs2).main-target ] ;
+ local cmt2-name ;
+ if $(cs2)-is-defined
+ {
+ local cmt2 = [ $(cs2).main-target ] ;
+ cmt2-name = [ $(cmt2).full-name ] ;
+ }
+ local extra-error-information ;
+ if ! $(cs1)-is-defined || ! $(cs2)-is-defined
+ {
+ extra-error-information = Encountered a virtual-target without a
+ creating subvariant. It could be the virtual target has not been
+ registered via the virtual-target.register rule. ;
+ }
 
         local action1 = [ $(.actual.$(actual-name)).action ] ;
         local action2 = [ $(virtual-target).action ] ;
@@ -1081,11 +1098,12 @@
         import errors : error : errors.error ;
         errors.error "Duplicate name of actual target:" $(actual-name)
             : "previous virtual target" [ $(.actual.$(actual-name)).str ]
- : "created from" [ $(cmt1).full-name ]
+ : "created from" $(cmt1-name)
             : "another virtual target" [ $(virtual-target).str ]
- : "created from" [ $(cmt2).full-name ]
+ : "created from" $(cmt2-name)
             : "added properties:" $(properties-added)
- : "removed properties:" $(properties-removed) ;
+ : "removed properties:" $(properties-removed)
+ : $(extra-error-information) ;
     }
     else
     {


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