aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/dist/types.hxx
blob: b8339519c467b47fe2eefaf6ed4d29d58dffcd5a (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
34
35
36
37
38
39
40
41
// file      : libbuild2/dist/types.hxx -*- C++ -*-
// license   : MIT; see accompanying LICENSE file

#ifndef LIBBUILD2_DIST_TYPES_HXX
#define LIBBUILD2_DIST_TYPES_HXX

#include <libbuild2/types.hxx>
#include <libbuild2/forward.hxx>

#include <libbuild2/prerequisite-key.hxx>

namespace build2
{
  namespace dist
  {
    // List of prerequisites that could not be searched to a target and were
    // postponed for later re-search. This can happen, for example, because a
    // prerequisite would resolve to a member of a group that hasn't been
    // matched yet (for example, libs{} of lib{}). See rule::apply() for
    // details.
    //
    // Note that we are using list instead of vector because new elements can
    // be added at the end while we are iterating over the list.
    //
    struct postponed_prerequisite
    {
      build2::action                          action;
      reference_wrapper<const build2::target> target;
      reference_wrapper<const prerequisite>   prereq;
      string                                  rule;
    };

    struct postponed_prerequisites
    {
      build2::mutex                        mutex;
      build2::list<postponed_prerequisite> list;
    };
  }
}

#endif // LIBBUILD2_DIST_TYPES_HXX