]> git.tdb.fi Git - builder.git/blobdiff - source/conditionalloader.cpp
Refactor transitive dependencies to work on all targets
[builder.git] / source / conditionalloader.cpp
diff --git a/source/conditionalloader.cpp b/source/conditionalloader.cpp
deleted file mode 100644 (file)
index 731c559..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <msp/strings/format.h>
-#include "booleanevaluator.h"
-#include "builder.h"
-#include "conditionalloader.h"
-#include "sourcepackage.h"
-
-using namespace std;
-using namespace Msp;
-
-ArchitectureConditional::ArchitectureConditional(const Builder &b, const string &l):
-       builder(b),
-       log_prefix(l)
-{
-       add("if_arch", &ArchitectureConditional::if_arch);
-}
-
-void ArchitectureConditional::if_arch(const string &cond)
-{
-       const Architecture &arch = builder.get_current_arch();
-       BooleanEvaluator eval([&arch](const string &value, const string *){ return arch.match_name(value); }, false);
-       bool match = eval.evaluate(cond);
-       builder.get_logger().log("configure", format("%s: arch %s %smatched", log_prefix, cond, (match ? "" : "not ")));
-       if(match)
-               load_sub_with(*this);
-}
-
-
-FeatureConditional::FeatureConditional(const SourcePackage &p, const string &l):
-       package(p),
-       log_prefix(l)
-{
-       add("if_feature", &FeatureConditional::if_feature);
-}
-
-void FeatureConditional::if_feature(const string &cond)
-{
-       BooleanEvaluator eval([this](const string &feat, const string *value){ return package.match_feature(feat, value); });
-       bool match = eval.evaluate(cond);
-       package.get_builder().get_logger().log("configure", format("%s: feature %s %smatched", log_prefix, cond, (match ? "" : "not ")));
-       if(match)
-               load_sub_with(*this);
-}
-
-
-ConditionalLoader::ConditionalLoader(const SourcePackage &p, const string &l):
-       ArchitectureConditional(p.get_builder(), l),
-       FeatureConditional(p, l)
-{ }