]> git.tdb.fi Git - builder.git/commitdiff
Support generators that require a switch before output file name
authorMikko Rasa <tdb@tdb.fi>
Wed, 12 Jun 2019 16:41:12 +0000 (19:41 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 12 Jun 2019 16:41:12 +0000 (19:41 +0300)
source/sourcegenerator.cpp
source/sourcegenerator.h

index 6394bd715861466eef2f6fc78640d795c35e31d2..c7a4f92204c214e2b9b5877d1cf258fefa4f9eb0 100644 (file)
@@ -75,6 +75,8 @@ Task *SourceGenerator::run(const Target &target) const
                if(const TemplateFile *tmpl = dynamic_cast<const TemplateFile *>(*i))
                        args.push_back(FS::relative(tmpl->get_path(), work_dir).str());
 
+       if(!out_argument.empty())
+               args.push_back(out_argument);
        args.push_back(FS::relative(out_src.get_path(), work_dir).str());
 
        return new ExternalTask(args, work_dir);
@@ -88,6 +90,7 @@ SourceGenerator::Loader::Loader(SourceGenerator &sg):
        add("argument",   &Loader::argument);
        add("command",    &Loader::command);
        add("in_suffix",  &Loader::in_suffix);
+       add("out_argument", &SourceGenerator::out_argument);
        add("out_suffix", &Loader::out_suffix);
        add("processing_unit", static_cast<ProcessingUnit SourceGenerator::*>(&SourceGenerator::processing_unit));
 }
index be7d675fe8027aee3bb8a6a9c96c221e07325235..69a41801e7b7e1e072812d00553e461468e18a53 100644 (file)
@@ -18,6 +18,7 @@ public:
                void argument(const std::string &);
                void command(const std::string &);
                void in_suffix(const std::string &);
+               void out_argument(const std::string &);
                void out_suffix(const std::string &);
        };
 
@@ -25,6 +26,7 @@ private:
        const SourcePackage &package;
        std::list<std::string> out_suffixes;
        std::list<std::string> arguments;
+       std::string out_argument;
 
 public:
        SourceGenerator(Builder &, const SourcePackage &, const std::string &);