diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-29 10:49:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-29 10:49:03 +0200 |
commit | c087efe145a75087acd646abe3258dad4aef4e2a (patch) | |
tree | 6ea006eed956d8b5c0793765be558f9c0a6dfd73 /build/file.cxx | |
parent | 56a6d901b9c06b58182ace0c83f2910d415293bb (diff) |
Update global scope config.import.* value to avoid warning
Diffstat (limited to 'build/file.cxx')
-rw-r--r-- | build/file.cxx | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/build/file.cxx b/build/file.cxx index f3f62ac..d3fc8eb 100644 --- a/build/file.cxx +++ b/build/file.cxx @@ -306,26 +306,30 @@ namespace build // for usability's sake, treat a simple name that doesn't end // with '/' as a directory. // - const list_value& lv (v.as<const list_value&> ()); + list_value& lv (v.as<list_value&> ()); - if (lv.size () == 1) - { - const name& n (lv.front ()); + if (lv.size () != 1 || lv[0].empty () || !lv[0].type.empty ()) + fail (l) << "invalid " << var << " value " << lv; - if (n.directory ()) - out_root = n.dir; - else if (n.simple ()) - out_root = dir_path (n.value); - } + name& n (lv[0]); - if (out_root.empty ()) - fail (l) << "invalid " << var << " value " << lv; + if (n.directory ()) + out_root = n.dir; + else + out_root = dir_path (n.value); if (out_root.relative ()) out_root = work / out_root; out_root.normalize (); iroot.assign (var) = out_root; + + // Also update the command-line value. This is necessary to avoid + // a warning issued by the config module about global/root scope + // value mismatch. + // + if (n.dir != out_root) + n = name (out_root); } } else |