diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2022-12-12 18:35:08 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2022-12-12 18:38:12 +0300 |
commit | 8cc86445437e7afc583dee18b36c0e8ba4b6fe12 (patch) | |
tree | 2215464b2434c5e34d748bb08f58b39a34aefd6e /libbutl/b.hxx | |
parent | 82982e037dea53b334070699471e682fb023dc9e (diff) |
Add support for omitting sub-projects from b_info() result
Diffstat (limited to 'libbutl/b.hxx')
-rw-r--r-- | libbutl/b.hxx | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/libbutl/b.hxx b/libbutl/b.hxx index cc3a309..d3fd2bf 100644 --- a/libbutl/b.hxx +++ b/libbutl/b.hxx @@ -51,11 +51,6 @@ namespace butl // result vector can be used to determine which project information caused // the error. // - // Unless you need information that may come from external modules - // (operations, meta-operations, etc), pass false as the ext_mods argument, - // which results in passing --no-external-modules to the build2 program and - // speeds up its execution. - // // You can also specify the build2 verbosity level, command line callback // (see process_run_callback() for details), build program search details, // and additional options. @@ -92,12 +87,35 @@ namespace butl std::vector<std::string> modules; }; + enum class b_info_flags: std::uint16_t + { + // Retrieve information that may come from external modules (operations, + // meta-operations, etc). Omitting this flag results in passing + // --no-external-modules to the build2 program and speeds up its + // execution. + // + ext_mods = 0x1, + + // Discover subprojects. Omitting this flag results in passing + // no_subprojects info meta-operation parameter to the build2 program and + // speeds up its execution. + // + subprojects = 0x2, + + none = 0 + }; + + inline b_info_flags operator& (b_info_flags, b_info_flags); + inline b_info_flags operator| (b_info_flags, b_info_flags); + inline b_info_flags operator&= (b_info_flags&, b_info_flags); + inline b_info_flags operator|= (b_info_flags&, b_info_flags); + using b_callback = void (const char* const args[], std::size_t n); LIBBUTL_SYMEXPORT void b_info (std::vector<b_project_info>& result, const std::vector<dir_path>& projects, - bool ext_mods, + b_info_flags, std::uint16_t verb = 1, const std::function<b_callback>& cmd_callback = {}, const path& program = path ("b"), @@ -108,7 +126,7 @@ namespace butl // inline b_project_info b_info (const dir_path& project, - bool ext_mods, + b_info_flags fl, std::uint16_t verb = 1, const std::function<b_callback>& cmd_callback = {}, const path& program = path ("b"), @@ -118,7 +136,7 @@ namespace butl std::vector<b_project_info> r; b_info (r, std::vector<dir_path> ({project}), - ext_mods, + fl, verb, cmd_callback, program, @@ -128,3 +146,5 @@ namespace butl return std::move (r[0]); } } + +#include <libbutl/b.ixx> |