aboutsummaryrefslogtreecommitdiff
path: root/mod/build-config.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-04-04 20:53:00 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-04-19 22:16:46 +0300
commitdbbc19b77dcf6ea828aabd64d7aa8cab9635aaf5 (patch)
treec0b9b449b7064dff3613628022224e6c18148c3e /mod/build-config.cxx
parentefb9c3e0e6b612d5bfadc7a2b984c14b5439335c (diff)
Implement build task, result and log requests handling
Diffstat (limited to 'mod/build-config.cxx')
-rw-r--r--mod/build-config.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/mod/build-config.cxx b/mod/build-config.cxx
new file mode 100644
index 0000000..11be1b9
--- /dev/null
+++ b/mod/build-config.cxx
@@ -0,0 +1,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>
+
+#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;
+ }
+}