1 #include <msp/strings/format.h>
2 #include "booleanevaluator.h"
4 #include "conditionalloader.h"
5 #include "sourcepackage.h"
10 ArchitectureConditional::ArchitectureConditional(const Builder &b, const string &l):
14 add("if_arch", &ArchitectureConditional::if_arch);
17 void ArchitectureConditional::if_arch(const string &cond)
19 BooleanEvaluator eval(sigc::hide<1>(sigc::mem_fun(&builder.get_current_arch(), &Architecture::match_name)), false);
20 bool match = eval.evaluate(cond);
21 builder.get_logger().log("configure", format("%s: arch %s %smatched", log_prefix, cond, (match ? "" : "not ")));
27 FeatureConditional::FeatureConditional(const SourcePackage &p, const string &l):
31 add("if_feature", &FeatureConditional::if_feature);
34 void FeatureConditional::if_feature(const string &cond)
36 BooleanEvaluator eval(sigc::mem_fun(&package, &SourcePackage::match_feature));
37 bool match = eval.evaluate(cond);
38 package.get_builder().get_logger().log("configure", format("%s: feature %s %smatched", log_prefix, cond, (match ? "" : "not ")));
44 ConditionalLoader::ConditionalLoader(const SourcePackage &p, const string &l):
45 ArchitectureConditional(p.get_builder(), l),
46 FeatureConditional(p, l)