blob: 9cbd1bf35d475cb9f38dd5c46efed8c09cbc3abc (
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
|
// file : mod/build-config.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : MIT; see accompanying LICENSE file
#include <mod/build-config.hxx>
#include <map>
namespace brep
{
using namespace bbot;
shared_ptr<const build_configs>
shared_build_config (const path& p)
{
static std::map<path, weak_ptr<build_configs>> configs;
auto i (configs.find (p));
if (i != configs.end ())
{
if (shared_ptr<build_configs> c = i->second.lock ())
return c;
}
shared_ptr<build_configs> c (
make_shared<build_configs> (parse_buildtab (p)));
configs[p] = c;
return c;
}
}
|