aboutsummaryrefslogtreecommitdiff
path: root/build/spec
blob: f50110ba915352e3de589ee02a2e90d9d0d23f3e (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// file      : build/spec -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

#ifndef BUILD_SPEC
#define BUILD_SPEC

#include <string>
#include <vector>
#include <iosfwd>
#include <utility> // move()

#include <build/types>

namespace build
{
  struct targetspec
  {
    typedef build::name name_type;

    explicit
    targetspec (name_type n): name (std::move (n)) {}
    targetspec (dir_path sb, name_type n)
        : src_base (std::move (sb)), name (std::move (n)) {}

    dir_path src_base;
    name_type name;
  };

  struct opspec: std::vector<targetspec>
  {
    opspec () = default;
    opspec (std::string n): name (std::move (n)) {}

    std::string name;
  };

  struct metaopspec: std::vector<opspec>
  {
    metaopspec () = default;
    metaopspec (std::string n): name (std::move (n)) {}

    std::string name;
  };

  typedef std::vector<metaopspec> buildspec;

  std::ostream&
  operator<< (std::ostream&, const targetspec&);

  std::ostream&
  operator<< (std::ostream&, const opspec&);

  std::ostream&
  operator<< (std::ostream&, const metaopspec&);

  std::ostream&
  operator<< (std::ostream&, const buildspec&);
}

#endif // BUILD_SPEC