aboutsummaryrefslogtreecommitdiff
path: root/bpkg/package.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-01-12 14:28:43 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-01-28 12:21:33 +0300
commitb90cbd6de11442500bbb6e0cdfe0bdcb286d67ec (patch)
tree22c89ff84779c8e4ccbae2b953b4110063fc52f6 /bpkg/package.hxx
parentf02e6f0bd299fc3b1dafb8c5b9bac78b78858e89 (diff)
Add support for multiple dependency alternatives
Diffstat (limited to 'bpkg/package.hxx')
-rw-r--r--bpkg/package.hxx30
1 files changed, 28 insertions, 2 deletions
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<version>