Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79931 - trunk/tools/build/v2/build
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-08 13:31:09


Author: jurko
Date: 2012-08-08 13:31:08 EDT (Wed, 08 Aug 2012)
New Revision: 79931
URL: http://svn.boost.org/trac/boost/changeset/79931

Log:
Added a better Boost Build diagnostic error message when attempting to reference a target using an explicitly specified project id but without a leading slash ('/') character, e.g. as in:

  use-project xxx : ../external/some-project ;
  exe a : xxx//some-obj ;

as opposed to:

  use-project xxx : ../external/some-project ;
  exe a : /xxx//some-obj ;
Text files modified:
   trunk/tools/build/v2/build/project.jam | 8 ++++++++
   trunk/tools/build/v2/build/targets.jam | 9 +++++++++
   2 files changed, 17 insertions(+), 0 deletions(-)

Modified: trunk/tools/build/v2/build/project.jam
==============================================================================
--- trunk/tools/build/v2/build/project.jam (original)
+++ trunk/tools/build/v2/build/project.jam 2012-08-08 13:31:08 EDT (Wed, 08 Aug 2012)
@@ -575,6 +575,14 @@
 }
 
 
+# Returns whether the given string is a valid registered project id.
+#
+rule is-registered-id ( id )
+{
+ return $($(id).jamfile-module) ;
+}
+
+
 # Associate the given id with the given project module. Returns the possibly
 # corrected project id.
 #

Modified: trunk/tools/build/v2/build/targets.jam
==============================================================================
--- trunk/tools/build/v2/build/targets.jam (original)
+++ trunk/tools/build/v2/build/targets.jam 2012-08-08 13:31:08 EDT (Wed, 08 Aug 2012)
@@ -374,6 +374,15 @@
             {
                 extra-error-message = could not resolve project reference
                     '$(project-part)' ;
+ if ! [ path.is-rooted $(project-part) ]
+ {
+ local rooted = [ path.root $(project-part) / ] ;
+ if [ project.is-registered-id $(rooted) ]
+ {
+ extra-error-message += - possibly missing a leading
+ slash ('/') character. ;
+ }
+ }
             }
         }
         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