diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-06-22 22:04:52 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-07-01 16:38:54 +0300 |
commit | 441cd214f04b8738c3fd92dd3c1a8ad1f2e56ba8 (patch) | |
tree | 49727c21918e0ef74a7c7e367b6396073d61f9aa /bpkg/pkg-configure.cxx | |
parent | ede8a15c2e310b2ae30894dd640f58d87a8a9408 (diff) |
Add support for building dependency in other configuration and re-pointing dependents to it
Diffstat (limited to 'bpkg/pkg-configure.cxx')
-rw-r--r-- | bpkg/pkg-configure.cxx | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/bpkg/pkg-configure.cxx b/bpkg/pkg-configure.cxx index 5c26fca..8161fbb 100644 --- a/bpkg/pkg-configure.cxx +++ b/bpkg/pkg-configure.cxx @@ -19,11 +19,13 @@ using namespace butl; namespace bpkg { package_prerequisites - pkg_configure_prerequisites (const common_options& o, - database& db, - transaction&, - const dependencies& deps, - const package_name& package) + pkg_configure_prerequisites ( + const common_options& o, + database& db, + transaction&, + const dependencies& deps, + const package_name& package, + const function<find_prereq_database_function>& find_db) { package_prerequisites r; @@ -58,8 +60,12 @@ namespace bpkg } } + database* ddb (find_db ? find_db (db, n, da.buildtime) : nullptr); + pair<shared_ptr<selected_package>, database*> spd ( - find_dependency (db, n, da.buildtime)); + ddb != nullptr + ? make_pair (ddb->find<selected_package> (n), ddb) + : find_dependency (db, n, da.buildtime)); if (const shared_ptr<selected_package>& dp = spd.first) { @@ -115,7 +121,8 @@ namespace bpkg const shared_ptr<selected_package>& p, const dependencies& deps, const strings& vars, - bool simulate) + bool simulate, + const function<find_prereq_database_function>& find_db) { tracer trace ("pkg_configure"); @@ -142,7 +149,12 @@ namespace bpkg // assert (p->prerequisites.empty ()); - p->prerequisites = pkg_configure_prerequisites (o, db, t, deps, p->name); + p->prerequisites = pkg_configure_prerequisites (o, + db, + t, + deps, + p->name, + find_db); if (!simulate) { |