]> git.tdb.fi Git - builder.git/commitdiff
Support conditionals inside source generator definitions
authorMikko Rasa <tdb@tdb.fi>
Wed, 15 Oct 2014 18:27:45 +0000 (21:27 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 15 Oct 2014 18:27:45 +0000 (21:27 +0300)
source/sourcegenerator.cpp
source/sourcegenerator.h

index 4f757217958a7acf8eb9a3a981a985d579e60ac3..76d6c892a20942647316b8c2eb8ac83629c215f0 100644 (file)
@@ -1,4 +1,5 @@
 #include <msp/fs/utils.h>
+#include <msp/strings/format.h>
 #include "builder.h"
 #include "executable.h"
 #include "externaltask.h"
@@ -69,7 +70,8 @@ Task *SourceGenerator::run(const Target &target) const
 
 
 SourceGenerator::Loader::Loader(SourceGenerator &sg):
-       DataFile::ObjectLoader<SourceGenerator>(sg)
+       DataFile::ObjectLoader<SourceGenerator>(sg),
+       ConditionalLoader(sg.package, format("%s/%s", sg.package.get_name(), sg.tag))
 {
        add("command",    &Loader::command);
        add("in_suffix",  &Loader::in_suffix);
index 28456ad6bdcc4a58b0a0ffd251c69e2b8d3d76fb..bb1a88e6a5f99abb871e4cdd0723611980683084 100644 (file)
@@ -2,13 +2,14 @@
 #define SOURCEGENERATOR_H_
 
 #include <msp/datafile/objectloader.h>
+#include "conditionalloader.h"
 #include "sourcepackage.h"
 #include "tool.h"
 
 class SourceGenerator: public Tool
 {
 public:
-       class Loader: public Msp::DataFile::ObjectLoader<SourceGenerator>
+       class Loader: public Msp::DataFile::ObjectLoader<SourceGenerator>, public ConditionalLoader
        {
        public:
                Loader(SourceGenerator &);