diff options
-rw-r--r-- | bpkg/common.cli | 10 | ||||
-rw-r--r-- | bpkg/pkg-command.cxx | 11 |
2 files changed, 20 insertions, 1 deletions
diff --git a/bpkg/common.cli b/bpkg/common.cli index 646cb2b..ab3d8bd 100644 --- a/bpkg/common.cli +++ b/bpkg/common.cli @@ -81,6 +81,16 @@ namespace bpkg \li|Even more detailed information.||" } + size_t --jobs|-j + { + "<num>", + "Number of jobs to perform in parallel. If this option is not + specified or specified with the \c{0} value, then the number of + available hardware threads is used. This option is also propagated + when performing build system operations such as \cb{update}, + \cb{test}, etc." + } + // In the future we may also have --structured-result, similar to the // build system. // diff --git a/bpkg/pkg-command.cxx b/bpkg/pkg-command.cxx index c66c8da..1d53e03 100644 --- a/bpkg/pkg-command.cxx +++ b/bpkg/pkg-command.cxx @@ -44,7 +44,16 @@ namespace bpkg { bspec += ')'; l4 ([&]{trace << "buildspec: " << bspec;}); - run_b (o, verb_b::normal, cvars, vars, bspec); + + run_b (o, + verb_b::normal, + (o.jobs_specified () + ? strings ({"-j", to_string (o.jobs ())}) + : strings ()), + cvars, + vars, + bspec); + bspec.clear (); } }; |