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/rule.cxx | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'build/bin/rule.cxx') diff --git a/build/bin/rule.cxx b/build/bin/rule.cxx index 1b887bf..d84af25 100644 --- a/build/bin/rule.cxx +++ b/build/bin/rule.cxx @@ -9,8 +9,6 @@ #include #include -#include - #include using namespace std; @@ -47,28 +45,16 @@ namespace build { lib& t (static_cast (xt)); - // Configure. - // - // The logic is as follows: if this library somehow knowns what - // it wants to be (i.e., the bin.lib is defined), then don't - // bother configuring the project-wide value. + // Get the library type to build. If not set for a target, this + // should be configured at the project scope by init_lib(). // - const string* type (nullptr); - - if (auto v = t["bin.lib"]) - type = &v.as (); - else - { - scope& root (*t.root_scope ()); - type = &config::required (root, "config.bin.lib", "shared").first; - root.assign ("bin.lib") = *type; - } + const string& type (t["bin.lib"].as ()); - bool ar (*type == "static" || *type == "both"); - bool so (*type == "shared" || *type == "both"); + bool ar (type == "static" || type == "both"); + bool so (type == "shared" || type == "both"); if (!ar && !so) - fail << "unknown library type: " << *type << + fail << "unknown library type: " << type << info << "'static', 'shared', or 'both' expected"; if (ar) -- cgit v1.1