From 49ecdc7c1e93a52147ce37d0cd7c8ef836fa5e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Wed, 8 Aug 2012 17:31:08 +0000 Subject: [PATCH] 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 ; [SVN r79931] --- src/build/project.jam | 8 ++++++++ src/build/targets.jam | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/build/project.jam b/src/build/project.jam index 8bf116ca5..d99f0aaa2 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -575,6 +575,14 @@ rule inherit-attributes ( project-module : parent-module ) } +# 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. # diff --git a/src/build/targets.jam b/src/build/targets.jam index 7a409ce88..9813e1cc2 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -374,6 +374,15 @@ class project-target : abstract-target { 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