]> git.tdb.fi Git - builder.git/blobdiff - source/package.cpp
Support boolean logic in conditions
[builder.git] / source / package.cpp
index aa9160e11b8e62ab03c16a0e961dc579bbe0894f..19ee511a814cf34bf46efd20f9409c7394b5d879 100644 (file)
@@ -1,6 +1,7 @@
 #include <msp/io/print.h>
 #include <msp/strings/lexicalcast.h>
 #include <msp/strings/utils.h>
+#include "booleanevaluator.h"
 #include "builder.h"
 #include "package.h"
 
@@ -38,7 +39,8 @@ Package::Loader::Loader(Package &p):
 
 void Package::Loader::if_arch(const string &cond)
 {
-       bool match = obj.builder.get_current_arch().match_name(cond);
+       BooleanEvaluator eval(sigc::hide<1>(sigc::mem_fun(&obj.builder.get_current_arch(), &Architecture::match_name)), false);
+       bool match = eval.evaluate(cond);
        obj.builder.get_logger().log("configure", format("%s: arch %s %smatched", obj.name, cond, (match ? "" : "not ")));
        if(match)
                load_sub_with(*this);