]> git.tdb.fi Git - builder.git/commitdiff
Check for some errors in SourceGenerator
authorMikko Rasa <tdb@tdb.fi>
Fri, 18 Nov 2016 20:29:49 +0000 (22:29 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 18 Nov 2016 20:29:49 +0000 (22:29 +0200)
source/sourcegenerator.cpp

index 9acd69658173657db5cc02d0f86094d247be1e63..f00b26bc8a5dc06bf1dddf2d0e79ac89ed171389 100644 (file)
@@ -24,6 +24,8 @@ Target *SourceGenerator::create_target(const list<Target *> &sources, const stri
 {
        if(sources.size()!=1)
                throw invalid_argument("SourceGenerator::create_target");
+       if(out_suffixes.empty())
+               throw logic_error("No output suffixes");
 
        TemplateFile &tmpl = dynamic_cast<TemplateFile &>(*sources.front());
        const Component *comp = tmpl.get_component();
@@ -45,6 +47,8 @@ Target *SourceGenerator::create_target(const list<Target *> &sources, const stri
                        else
                                primary = target;
                }
+               else
+                       throw runtime_error("No tool found for suffix "+*i);
        }
 
        return primary;