From f103f86ec3247ff27e7cc23dfce5e426f385ed8c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 24 Apr 2015 16:55:55 +0200 Subject: Take one on library linking --- build/bin/module.cxx | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 build/bin/module.cxx (limited to 'build/bin/module.cxx') 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 + +#include +#include +#include + +#include + +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; + } + } + } +} -- cgit v1.1