aboutsummaryrefslogtreecommitdiff
path: root/build/bin/rule.cxx
diff options
context:
space:
mode:
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)