aboutsummaryrefslogtreecommitdiff
path: root/libbrep/package.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-10-28 23:21:29 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-11-23 19:20:35 +0300
commit03c931e54e618221b69cfcd3dfb462e50ecad780 (patch)
treee9fa949151f518f0fdfb05db473fc538f20310ff /libbrep/package.cxx
parent5bf2dd09110f257acc730eab71301e1dede1c710 (diff)
Add support for package build configurations
Diffstat (limited to 'libbrep/package.cxx')
-rw-r--r--libbrep/package.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/libbrep/package.cxx b/libbrep/package.cxx
index 5f99fbb..152d1d8 100644
--- a/libbrep/package.cxx
+++ b/libbrep/package.cxx
@@ -77,6 +77,7 @@ namespace brep
small_vector<test_dependency, 1> ts,
build_class_exprs bs,
build_constraints_type bc,
+ build_package_configs bcs,
optional<path> lc,
optional<string> fr,
optional<string> sh,
@@ -114,6 +115,24 @@ namespace brep
fragment (move (fr)),
sha256sum (move (sh))
{
+ // Add the default build configuration at the beginning, unless it is
+ // specified explicitly.
+ //
+ if (find_if (bcs.begin (), bcs.end (),
+ [] (const build_package_config& c)
+ {return c.name == "default";}) != bcs.end ())
+ {
+ build_configs = move (bcs);
+ }
+ else
+ {
+ build_configs.reserve (bcs.size () + 1);
+ build_configs.emplace_back ("default");
+ build_configs.insert (build_configs.end (),
+ make_move_iterator (bcs.begin ()),
+ make_move_iterator (bcs.end ()));
+ }
+
if (stub ())
unbuildable_reason = brep::unbuildable_reason::stub;
else if (!internal_repository->buildable)