]> git.tdb.fi Git - builder.git/blobdiff - source/gnucompiler.cpp
Add support for specifying the language standard to use
[builder.git] / source / gnucompiler.cpp
index a86cb59d0567b06f4e88c07a72e2ddbd4dd17d49..051722832ea66402e515733fb51cd5c6ad78aa8e 100644 (file)
@@ -1,3 +1,4 @@
+#include <msp/core/maputils.h>
 #include <msp/fs/dir.h>
 #include <msp/fs/utils.h>
 #include <msp/strings/format.h>
@@ -89,6 +90,12 @@ Task *GnuCompiler::run(const Target &target) const
        BuildInfo binfo;
        target.collect_build_info(binfo);
 
+       string tag_for_std = (tag=="OBJC" ? "CC" : tag);
+       if(binfo.standards.count(tag_for_std))
+               argv.push_back("-std="+get_item(binfo.standards, tag_for_std));
+       if(tag=="OBJC" && binfo.standards.count(tag))
+               argv.push_back("-fobjc-std="+get_item(binfo.standards, tag));
+
        if(binfo.warning_level>=1)
        {
                argv.push_back("-Wall");