From b90cbd6de11442500bbb6e0cdfe0bdcb286d67ec Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 12 Jan 2022 14:28:43 +0300 Subject: Add support for multiple dependency alternatives --- bpkg/package.hxx | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'bpkg/package.hxx') diff --git a/bpkg/package.hxx b/bpkg/package.hxx index ec6aa67..0c70328 100644 --- a/bpkg/package.hxx +++ b/bpkg/package.hxx @@ -556,6 +556,11 @@ namespace bpkg dependency_alternatives_ex (dependency_alternatives da) : dependency_alternatives (move (da)) {} + // As above but built incrementally. + // + dependency_alternatives_ex (bool b, std::string c) + : dependency_alternatives (b, move (c)) {} + // Create the special test dependencies object (built incrementally). // dependency_alternatives_ex (test_dependency_type t, bool buildtime) @@ -575,6 +580,29 @@ namespace bpkg make_move_iterator (das.end ())); } + // If this is a toolchain build-time dependency, then verify its constraint + // returning true if it is satisfied and failing otherwise. Return false for + // a regular dependency. Note that the package argument is used for + // diagnostics only. + // + class common_options; + + bool + toolchain_buildtime_dependency (const common_options&, + const dependency_alternatives_ex&, + const package_name&); + + // Return true if the dependency alternative enable condition is not + // specified or evaluates to true. Note that the package argument is used + // for diagnostics only. + // + // @@ DEP We will also need to pass some additional information here for + // the actual evaluation (bootstrap/root buildfiles, reflect clauses of + // already selected dependency alternatives, etc). + // + bool + evaluate_enabled (const dependency_alternative&, const package_name&); + // tests // #pragma db value(test_dependency) definition @@ -1225,8 +1253,6 @@ namespace bpkg // - The manifest file located in the specified directory is not parsed, and // so is not checked to match the specified package name and version. // - class common_options; - // Note: loads selected packages. // optional -- cgit v1.1