From 7fa57f8522ed7741c00ed3cd64cf956716aebd2c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 11 Mar 2024 21:23:21 +0300 Subject: Add support for build auxiliary machines/configurations --- libbrep/package.cxx | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'libbrep/package.cxx') diff --git a/libbrep/package.cxx b/libbrep/package.cxx index 2320547..37795f0 100644 --- a/libbrep/package.cxx +++ b/libbrep/package.cxx @@ -81,6 +81,7 @@ namespace brep small_vector ts, build_class_exprs bs, build_constraints_type bc, + build_auxiliaries_type ac, build_package_configs bcs, optional lc, optional fr, @@ -114,28 +115,17 @@ namespace brep tests (move (ts)), builds (move (bs)), build_constraints (move (bc)), + build_auxiliaries (move (ac)), + build_configs (move (bcs)), internal_repository (move (rp)), location (move (lc)), fragment (move (fr)), sha256sum (move (sh)) { - // Add the default build configuration at the beginning, unless it is - // specified explicitly. + // The default configuration is always added by the package manifest + // parser (see libbpkg/manifest.cxx for details). // - 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 ())); - } + assert (find ("default", build_configs) != nullptr); if (stub ()) unbuildable_reason = brep::unbuildable_reason::stub; @@ -152,6 +142,8 @@ namespace brep version_type vr, build_class_exprs bs, build_constraints_type bc, + build_auxiliaries_type ac, + build_package_configs bcs, shared_ptr rp) : id (rp->tenant, move (nm), vr), tenant (id.tenant), @@ -159,11 +151,18 @@ namespace brep version (move (vr)), builds (move (bs)), build_constraints (move (bc)), + build_auxiliaries (move (ac)), + build_configs (move (bcs)), buildable (false), unbuildable_reason (stub () ? brep::unbuildable_reason::stub : brep::unbuildable_reason::external) { + // The default configuration is always added by the package manifest + // parser (see libbpkg/manifest.cxx for details). + // + assert (find ("default", build_configs) != nullptr); + assert (!rp->internal); other_repositories.emplace_back (move (rp)); } -- cgit v1.1