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

#ifndef BUILD_CONTEXT
#define BUILD_CONTEXT

#include <string>
#include <ostream>

#include <build/path>

namespace build
{
  class scope;

  extern path work;
  extern path home;

  // Return the src/out directory corresponding to the given out/src. The
  // passed directory should be a sub-directory of out/src_root.
  //
  path
  src_out (const path& out, scope&);

  path
  src_out (const path& out, const path& out_root, const path& src_root);

  path
  out_src (const path& src, scope&);

  path
  out_src (const path& src, const path& out_root, const path& src_root);

  // If possible and beneficial, translate an absolute, normalized path
  // into relative to the work directory.
  //
  path
  relative_work (const path&);
}

#endif // BUILD_CONTEXT