aboutsummaryrefslogtreecommitdiff
path: root/bpkg/package.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/package.ixx')
-rw-r--r--bpkg/package.ixx20
1 files changed, 19 insertions, 1 deletions
diff --git a/bpkg/package.ixx b/bpkg/package.ixx
index f6aa6c4..9c85407 100644
--- a/bpkg/package.ixx
+++ b/bpkg/package.ixx
@@ -1,5 +1,4 @@
// file : bpkg/package.ixx -*- C++ -*-
-// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
// license : MIT; see accompanying LICENSE file
namespace bpkg
@@ -12,4 +11,23 @@ namespace bpkg
version (v)
{
}
+
+ template <typename T>
+ inline bool
+ has_buildfile_clause (const vector<T>& ds)
+ {
+ for (const dependency_alternatives& das: ds)
+ {
+ for (const dependency_alternative& da: das)
+ {
+ // Note: the accept clause cannot be present if the prefer clause is
+ // absent.
+ //
+ if (da.enable || da.reflect || da.prefer || da.require)
+ return true;
+ }
+ }
+
+ return false;
+ }
}