diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-10-07 08:17:49 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-10-08 15:05:21 +0200 |
commit | 8384a087afc7e29e900a3ce96d55ab2f5c2a74c2 (patch) | |
tree | deff3d99e33bfc7abecb3ef0422ccb2dd6c3d43b /libbuild2/config/module.cxx | |
parent | 734bf117f0eb596fc40579810613a6e13c43d3c4 (diff) |
Expose custom save function in config module
It can generally be useful, for example, to complete relative paths before
saving them to config.build (if abs_dir_path does not fit).
Diffstat (limited to 'libbuild2/config/module.cxx')
-rw-r--r-- | libbuild2/config/module.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libbuild2/config/module.cxx b/libbuild2/config/module.cxx index 713d30c..faae865 100644 --- a/libbuild2/config/module.cxx +++ b/libbuild2/config/module.cxx @@ -14,7 +14,7 @@ namespace build2 bool module:: save_variable (const variable& var, optional<uint64_t> flags, - save_variable_function* save) + save_variable_function* func) { const string& n (var.name); @@ -45,15 +45,18 @@ namespace build2 return false; } - sv.push_back (saved_variable {var, flags, save}); + sv.push_back (saved_variable {var, flags, func}); return true; } void module:: - save_variable (scope& rs, const variable& var, optional<uint64_t> flags) + save_variable (scope& rs, + const variable& var, + optional<uint64_t> flags, + save_variable_function* func) { if (module* m = rs.find_module<module> (module::name)) - m->save_variable (var, flags); + m->save_variable (var, flags, func); } void module:: |