From: Mikko Rasa Date: Wed, 15 Oct 2014 18:27:45 +0000 (+0300) Subject: Support conditionals inside source generator definitions X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=9053d11310842cb9b8a0f13fe1d86b60cae5231c;p=builder.git Support conditionals inside source generator definitions --- diff --git a/source/sourcegenerator.cpp b/source/sourcegenerator.cpp index 4f75721..76d6c89 100644 --- a/source/sourcegenerator.cpp +++ b/source/sourcegenerator.cpp @@ -1,4 +1,5 @@ #include +#include #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(sg) + DataFile::ObjectLoader(sg), + ConditionalLoader(sg.package, format("%s/%s", sg.package.get_name(), sg.tag)) { add("command", &Loader::command); add("in_suffix", &Loader::in_suffix); diff --git a/source/sourcegenerator.h b/source/sourcegenerator.h index 28456ad..bb1a88e 100644 --- a/source/sourcegenerator.h +++ b/source/sourcegenerator.h @@ -2,13 +2,14 @@ #define SOURCEGENERATOR_H_ #include +#include "conditionalloader.h" #include "sourcepackage.h" #include "tool.h" class SourceGenerator: public Tool { public: - class Loader: public Msp::DataFile::ObjectLoader + class Loader: public Msp::DataFile::ObjectLoader, public ConditionalLoader { public: Loader(SourceGenerator &);