aboutsummaryrefslogtreecommitdiff
path: root/bpkg/package.ixx
blob: 9c85407c2ab8c6f9dad9b8ff83955ae2fa3a6680 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// file      : bpkg/package.ixx -*- C++ -*-
// license   : MIT; see accompanying LICENSE file

namespace bpkg
{
  // available_package_id
  //
  inline available_package_id::
  available_package_id (package_name n, const bpkg::version& v)
      : name (move (n)),
        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;
  }
}