libmode = bi.libmode;
for(LibModeMap::const_iterator i=bi.libmodes.begin(); i!=bi.libmodes.end(); ++i)
libmodes[i->first] = i->second;
+ for(StandardMap::const_iterator i=bi.standards.begin(); i!=bi.standards.end(); ++i)
+ standards[i->first] = i->second;
debug = bi.debug;
optimize = bi.optimize;
strip = bi.strip;
add("libmode", &Loader::libmode_for_lib);
add("local_incpath", &Loader::local_incpath);
add("optimize", &BuildInfo::optimize);
+ add("standard", &Loader::standard);
add("strip", &BuildInfo::strip);
add("sysroot", &Loader::sysroot);
add("threads", &BuildInfo::threads);
obj.local_incpath.push_back(s);
}
+void BuildInfo::Loader::standard(DataFile::Symbol tag, const string &std)
+{
+ obj.standards[tag.name] = std;
+}
+
void BuildInfo::Loader::sysroot(const string &s)
{
obj.sysroot = s;
void libpath(const std::string &);
void library(const std::string &);
void local_incpath(const std::string &);
+ void standard(Msp::DataFile::Symbol, const std::string &);
void sysroot(const std::string &);
};
typedef std::list<Msp::FS::Path> PathList;
typedef std::list<std::string> WordList;
typedef std::map<std::string, LibraryMode> LibModeMap;
+ typedef std::map<std::string, std::string> StandardMap;
Tracked<Msp::FS::Path> sysroot;
DefineMap defines;
WordList libs;
Tracked<LibraryMode> libmode;
LibModeMap libmodes;
+ StandardMap standards;
Tracked<bool> threads;
Tracked<bool> debug;
Tracked<int> optimize;
+#include <msp/core/maputils.h>
#include <msp/fs/dir.h>
#include <msp/fs/utils.h>
#include <msp/strings/format.h>
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");