aboutsummaryrefslogtreecommitdiff
path: root/bpkg/utility.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-09-05 09:24:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-09-05 09:24:39 +0200
commita3925d12af6a6ae75897d5aab25a9de0edb642fb (patch)
treec7a95927bbc339f873f58ba3bab63916eced71fb /bpkg/utility.cxx
parent3469e1d984c6ae000b59c471e6ef84c4b43497f2 (diff)
Add support for build-time dependencies
Diffstat (limited to 'bpkg/utility.cxx')
-rw-r--r--bpkg/utility.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/bpkg/utility.cxx b/bpkg/utility.cxx
index 002d316..5d37972 100644
--- a/bpkg/utility.cxx
+++ b/bpkg/utility.cxx
@@ -7,6 +7,7 @@
#include <iostream> // cout, cin
#include <butl/process>
+#include <butl/fdstream>
#include <bpkg/diagnostics>
#include <bpkg/common-options>
@@ -195,6 +196,14 @@ namespace bpkg
}
}
+ const char*
+ name_b (const common_options& co)
+ {
+ return co.build_specified ()
+ ? co.build ().string ().c_str ()
+ : "b" BPKG_EXE_SUFFIX;
+ }
+
void
run_b (const common_options& co,
const dir_path& c,
@@ -203,11 +212,7 @@ namespace bpkg
const strings& pvars,
const strings& cvars)
{
- const char* b (co.build_specified ()
- ? co.build ().string ().c_str ()
- : "b" BPKG_EXE_SUFFIX);
-
- cstrings args {b};
+ cstrings args {name_b (co)};
// Map verbosity level. If we are running quiet or at level 1,
// then run build2 quiet. Otherwise, run it at the same level