aboutsummaryrefslogtreecommitdiff
path: root/build/bin/rule.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/rule.cxx
parent2a0f9e035f673f1ee387924501a31990de37f18d (diff)
Take one on library linking
Diffstat (limited to 'build/bin/rule.cxx')
-rw-r--r--build/bin/rule.cxx26
1 files changed, 6 insertions, 20 deletions
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 <build/algorithm>
#include <build/diagnostics>
-#include <build/config/utility>
-
#include <build/bin/target>
using namespace std;
@@ -47,28 +45,16 @@ namespace build
{
lib& t (static_cast<lib&> (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<const string&> ();
- 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<const string&> ());
- 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)