aboutsummaryrefslogtreecommitdiff
path: root/build/prerequisite.cxx
blob: 8153a6cf0c45a408fb609d4cbc866339f3212f62 (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
// file      : build/prerequisite.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
// license   : MIT; see accompanying LICENSE file

#include <build/prerequisite>

#include <ostream>

#include <build/target> // target_type

using namespace std;

namespace build
{
  ostream&
  operator<< (ostream& os, const prerequisite& p)
  {
    // @@ TODO: need to come up with a relative (to current) path.

    return os << p.type.name << '{' << p.name << '}';
  }

  bool
  operator< (const prerequisite& x, const prerequisite& y)
  {
    return
      (x.type.id < y.type.id) ||
      (x.type.id == y.type.id && x.name < y.name) ||
      (x.type.id == y.type.id && x.name == y.name &&
       x.directory < y.directory);
  }
}