diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-03-16 08:06:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-03-17 07:47:17 +0200 |
commit | 9f71deeeb0f8e6fe2c29f209fc96f466fc2831b6 (patch) | |
tree | 81e07870c7a16f12c7aca69bf70a71d69251d1fc /libbuild2/install/init.cxx | |
parent | 1adbf7b710d52958f6c0168ccb492252c1f19d4a (diff) |
Rework config::{omitted,required,optional}() into unified config_lookup()
Diffstat (limited to 'libbuild2/install/init.cxx')
-rw-r--r-- | libbuild2/install/init.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libbuild2/install/init.cxx b/libbuild2/install/init.cxx index 34a5625..06e5d3a 100644 --- a/libbuild2/install/init.cxx +++ b/libbuild2/install/init.cxx @@ -63,11 +63,13 @@ namespace build2 vn += var; const variable& vr (rs.var_pool ().insert<CT> (move (vn), true)); + using config::lookup_config; + l = dv != nullptr - ? config::required (rs, vr, *dv, override).first + ? lookup_config (rs, vr, *dv, 0 /* save_flags */, override) : (global - ? config::optional (rs, vr) - : config::omitted (rs, vr).first); + ? lookup_config (rs, vr, nullptr) + : lookup_config (rs, vr)); } if (global) @@ -237,8 +239,10 @@ namespace build2 // { using build2::path; + using config::lookup_config; + using config::specified_config; - bool s (config::specified (rs, "install")); + bool s (specified_config (rs, "install")); // Adjust module priority so that the (numerous) config.install.* // values are saved at the end of config.build. @@ -280,7 +284,7 @@ namespace build2 if (s) { - if (lookup l = config::optional (rs, cvar)) + if (lookup l = lookup_config (rs, cvar, nullptr)) v = cast<dir_path> (l); // Strip abs_dir_path. } } |