native = true;
}
- if(toolchain.empty())
- {
- if((system=="darwin" || system=="freebsd") && builder.get_vfs().find_binary("clang"))
- toolchain = "clang";
- else if(system=="windows" && native)
- toolchain = "msvc";
- else
- toolchain = "gnu";
- }
-
update();
}
name += format("-%s", cpu);
if(!fpu.empty())
name += format("-%s", fpu);
- name += format("-%d-%s-%s", bits, system, toolchain);
+ name += format("-%d-%s", bits, system);
+ if(!toolchain.empty())
+ name += format("-%s", toolchain);
filename_patterns.clear();
if(system=="windows")
for(unsigned j=0; (!ok && systems[j]); ++j)
if(p==systems[j])
{
+ if(!system.empty() && p!=system)
+ throw invalid_argument("Conflicting system specification");
system = p;
ok = true;
}
for(unsigned j=0; (!ok && toolchains[j]); ++j)
if(p==toolchains[j])
{
+ if(!toolchain.empty() && p!=toolchain)
+ throw invalid_argument("Conflicting toolchain specification");
toolchain = p;
ok = true;
}
if(!ok && (p=="32" || p=="64"))
{
- bits = lexical_cast<unsigned>(p);
+ unsigned b = lexical_cast<unsigned>(p);
+ if(bits && b!=bits)
+ throw invalid_argument("Conflicting bits specification");
+ bits = b;
ok = true;
}
Architecture::Loader::Loader(Architecture &a):
DataFile::ObjectLoader<Architecture>(a)
{
- add("prefix", &Architecture::cross_prefix);
+ add("prefix", &Loader::cross_prefix);
+}
+
+void Architecture::Loader::cross_prefix(const string &p)
+{
+ if(!obj.native)
+ obj.cross_prefix = p;
}