diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-02-02 12:15:48 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-02-02 12:15:48 +0200 |
commit | 9126f3718d1efce28573e3bb5e0aacfd42d59fb0 (patch) | |
tree | 4f7500bfa9c31d53fd817da1b9cf7b408a5632a2 | |
parent | 53e34adc6fa856fcc55c0917dbfc9bbc855cb5ad (diff) |
Complete and normalize --default-options path
-rw-r--r-- | libbuild2/b-cmdline.cxx | 17 |
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 ( |