aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/make-parser.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/make-parser.cxx')
-rw-r--r--libbuild2/make-parser.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/libbuild2/make-parser.cxx b/libbuild2/make-parser.cxx
index d076a0a..cab81d0 100644
--- a/libbuild2/make-parser.cxx
+++ b/libbuild2/make-parser.cxx
@@ -11,7 +11,7 @@ namespace build2
next (const string& l,
size_t& p,
const location& ll,
- bool strict) -> pair<type, string>
+ bool strict) -> pair<type, path>
{
assert (state != end);
@@ -55,7 +55,16 @@ namespace build2
state = end; // Not a mere optimization: the caller will get next line.
}
- return pair<type, string> (t, move (r.first));
+ try
+ {
+ return pair<type, path> (t, path (move (r.first)));
+ }
+ catch (const invalid_path& e)
+ {
+ fail (ll) << "invalid make "
+ << (t == type::prereq ? "prerequisite" : "target")
+ << " path '" << e.path << "'" << endf;
+ }
}
pair<string, bool> make_parser::