aboutsummaryrefslogtreecommitdiff
path: root/build/cli/target.cxx
blob: 95198e1d947e6b8c2fa69a4bd4f647dcfa059bce (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
// file      : build/cli/target.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

#include <build/cli/target>

#include <butl/filesystem>

using namespace std;
using namespace butl;

namespace build
{
  namespace cli
  {
    // cli
    //
    constexpr const char cli_ext[] = "cli";
    const target_type cli::static_type
    {
      typeid (cli),
      "cli",
      &file::static_type,
      &target_factory<cli>,
      &target_extension_fix<cli_ext>,
      &search_file,
      false
    };

    // cli.cxx
    //
    group_view cli_cxx::
    group_members (action) const
    {
      return h != nullptr
        ? group_view {m, (i != nullptr ? 3U : 2U)}
        : group_view {nullptr, 0};
    }

    timestamp cli_cxx::
    load_mtime () const
    {
      // The rule has been matched which means the members should
      // be resolved and paths assigned.
      //
      return file_mtime (h->path ());
    }

    const target_type cli_cxx::static_type
    {
      typeid (cli_cxx),
      "cli.cxx",
      &mtime_target::static_type,
      &target_factory<cli_cxx>,
      nullptr,
      &search_target,
      true // See through default semantics.
    };
  }
}