+++ /dev/null
-#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){ return arch.match_name(value); });
- bool match = eval.evaluate(cond);
- builder.get_logger().log("configure", "%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", "%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)
-{ }