From 03c931e54e618221b69cfcd3dfb462e50ecad780 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 28 Oct 2022 23:21:29 +0300 Subject: Add support for package build configurations --- libbrep/package.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libbrep/package.cxx') 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 ts, build_class_exprs bs, build_constraints_type bc, + build_package_configs bcs, optional lc, optional fr, optional 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) -- cgit v1.1