GnuLinker::Linker::Linker(GnuLinker &p, const string &ct):
SubTool(p),
compiler_tag(ct)
-{ }
+{
+ if(compiler_tag=="CC")
+ set_command("gcc", true);
+ else if(compiler_tag=="CXX")
+ set_command("g++", true);
+ else
+ throw invalid_argument("GnuLinker::Linker::Linker");
+}
Target *GnuLinker::Linker::create_target(const list<Target *> &sources, const string &arg)
{
compiler.prepare();
executable = compiler.get_executable();
}
- else
- {
- string command;
- if(compiler_tag=="CC")
- command = "gcc";
- else if(compiler_tag=="CXX")
- command = "g++";
- else
- throw invalid_argument("GnuLinker::Linker::Linker");
-
- set_executable(command, true);
- }
}
Task *GnuLinker::Linker::run(const Target &target) const
argv.push_back("-L"+i->str());
if(binfo.strip)
argv.push_back("-s");
- if(binfo.threads)
+ if(binfo.threads && architecture->get_system()!="windows")
argv.push_back("-pthread");
const Architecture &native_arch = builder.get_native_arch();