From ae85358a5f3d408f9886f58c8cdb2c6c92c3a25a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 12 Jun 2019 19:41:12 +0300 Subject: [PATCH] Support generators that require a switch before output file name --- source/sourcegenerator.cpp | 3 +++ source/sourcegenerator.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/source/sourcegenerator.cpp b/source/sourcegenerator.cpp index 6394bd7..c7a4f92 100644 --- a/source/sourcegenerator.cpp +++ b/source/sourcegenerator.cpp @@ -75,6 +75,8 @@ Task *SourceGenerator::run(const Target &target) const if(const TemplateFile *tmpl = dynamic_cast(*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(&SourceGenerator::processing_unit)); } diff --git a/source/sourcegenerator.h b/source/sourcegenerator.h index be7d675..69a4180 100644 --- a/source/sourcegenerator.h +++ b/source/sourcegenerator.h @@ -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 out_suffixes; std::list arguments; + std::string out_argument; public: SourceGenerator(Builder &, const SourcePackage &, const std::string &); -- 2.45.2