From 786ea71a81eb563df5aaf48d11ac75f33dc6d8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Tue, 7 Aug 2012 13:13:41 +0000 Subject: [PATCH] Corrected Boost Build's error message displayed when a target id is encountered containing an unresolvable explicit project reference. [SVN r79906] --- v2/build/targets.jam | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/v2/build/targets.jam b/v2/build/targets.jam index a0401893e..30d588c34 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -372,11 +372,7 @@ class project-target : abstract-target } else { - # TODO: This extra error message will not get displayed most - # likely due to some buggy refactoring. Refactor the code so the - # message gets diplayed again. - extra-error-message = error: could not find project - '$(project-part)' ; + extra-error-message = could not find project '$(project-part)' ; } } else @@ -417,7 +413,7 @@ class project-target : abstract-target } } - return $(result) ; + return $(result:E="") $(extra-error-message) ; } # Find and return the target with the specified id, treated relative to @@ -428,9 +424,12 @@ class project-target : abstract-target rule find ( id : no-error ? ) { local v = $(.id.$(id)) ; + local extra-error-message ; if ! $(v) { - v = [ find-really $(id) ] ; + local r = [ find-really $(id) ] ; + v = $(r[1]) ; + extra-error-message = $(r[2-]) ; if ! $(v) { v = none ; @@ -442,18 +441,15 @@ class project-target : abstract-target { return $(v) ; } - else + else if ! $(no-error) { - if ! $(no-error) - { - local current-location = [ get location ] ; - ECHO "error: Unable to find file or target named" ; - ECHO "error: '$(id)'" ; - ECHO "error: referred from project at" ; - ECHO "error: '$(current-location)'" ; - ECHO $(extra-error-message) ; - EXIT ; - } + local current-location = [ get location ] ; + import errors : user-error : errors.user-error ; + errors.user-error Unable to find file or target named + : " " '$(id)' + : referred from project at + : " " '$(current-location)' + : $(extra-error-message) ; } }