aboutsummaryrefslogtreecommitdiff
path: root/build/bin/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-24 16:55:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-24 16:55:55 +0200
commitf103f86ec3247ff27e7cc23dfce5e426f385ed8c (patch)
tree4efffb7d254e494944ce555d343c34d957238be0 /build/bin/module.cxx
parent2a0f9e035f673f1ee387924501a31990de37f18d (diff)
Take one on library linking
Diffstat (limited to 'build/bin/module.cxx')
-rw-r--r--build/bin/module.cxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/build/bin/module.cxx b/build/bin/module.cxx
new file mode 100644
index 0000000..89ea9fe
--- /dev/null
+++ b/build/bin/module.cxx
@@ -0,0 +1,58 @@
+// file : build/bin/module.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#include <build/bin/module>
+
+#include <build/scope>
+#include <build/variable>
+#include <build/diagnostics>
+
+#include <build/config/utility>
+
+using namespace std;
+
+namespace build
+{
+ namespace bin
+ {
+ void
+ init (scope& root, scope& base, const location& l)
+ {
+ //@@ TODO: avoid multiple inits (generally, for modules).
+ //
+ tracer trace ("bin::init");
+
+ //@@ Should it be this way?
+ //
+ if (&root != &base)
+ fail (l) << "bin module must be initialized in project root scope";
+
+ //@@ TODO: need to register target types, rules here instead of main().
+
+ const dir_path& out_root (root.path ());
+ level4 ([&]{trace << "for " << out_root;});
+
+ // Configure.
+ //
+ }
+
+ void
+ init_lib (const dir_path& d)
+ {
+ scope* root (scopes.find (d).root_scope ());
+
+ if (root == nullptr)
+ return;
+
+ // config.bin.lib
+ //
+ {
+ auto v (root->vars.assign ("bin.lib"));
+
+ if (!v)
+ v = config::required (*root, "config.bin.lib", "shared").first;
+ }
+ }
+ }
+}