aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-10-13 12:20:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-10-13 12:21:11 +0200
commite9e9c5c20f70367ce33e023455c7080186e615e2 (patch)
tree64cb36490ab7b5e8ccc863dc9ce7a577204ea3bc /libbuild2
parentf59d82eb8fda3ddcf790556c6c3615e40ae8b15b (diff)
Improve diagnostics
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/install/rule.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx
index 756d5a8..9f01578 100644
--- a/libbuild2/install/rule.cxx
+++ b/libbuild2/install/rule.cxx
@@ -697,6 +697,10 @@ namespace build2
bool n (!p->to_directory ());
dir_path d (n ? p->directory () : path_cast<dir_path> (*p));
+ if (n && d.empty ())
+ fail << "relative installation file path '" << p
+ << "' has no directory component";
+
install_dirs ids (resolve (f, d));
if (!n)
@@ -997,6 +1001,10 @@ namespace build2
bool n (!p.to_directory ());
dir_path d (n ? p.directory () : path_cast<dir_path> (p));
+ if (n && d.empty ())
+ fail << "relative installation file path '" << p
+ << "' has no directory component";
+
// Resolve target directory.
//
install_dirs ids (resolve (t, d));
@@ -1296,6 +1304,10 @@ namespace build2
bool n (!p.to_directory ());
dir_path d (n ? p.directory () : path_cast<dir_path> (p));
+ if (n && d.empty ())
+ fail << "relative installation file path '" << p
+ << "' has no directory component";
+
// Resolve target directory.
//
install_dirs ids (resolve (t, d));