aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-02-02 12:15:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-02-02 12:15:48 +0200
commit9126f3718d1efce28573e3bb5e0aacfd42d59fb0 (patch)
tree4f7500bfa9c31d53fd817da1b9cf7b408a5632a2 /libbuild2
parent53e34adc6fa856fcc55c0917dbfc9bbc855cb5ad (diff)
Complete and normalize --default-options path
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/b-cmdline.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/libbuild2/b-cmdline.cxx b/libbuild2/b-cmdline.cxx
index 8d78036..b7d0726 100644
--- a/libbuild2/b-cmdline.cxx
+++ b/libbuild2/b-cmdline.cxx
@@ -286,8 +286,25 @@ namespace build2
{
optional<dir_path> extra;
if (ops.default_options_specified ())
+ {
extra = ops.default_options ();
+ // Note that load_default_options() expects absolute and normalized
+ // directory.
+ //
+ try
+ {
+ if (extra->relative ())
+ extra->complete ();
+
+ extra->normalize ();
+ }
+ catch (const invalid_path& e)
+ {
+ fail << "invalid --default-options value " << e.path;
+ }
+ }
+
// Load default options files.
//
default_options<b_options> def_ops (