BUG: use c compiler for link of c programs, and use temp file nmake syntax for linking c and c++ programs
This commit is contained in:
parent
4380c3b0f1
commit
5be8fa451a
|
@ -521,8 +521,21 @@ void cmNMakeMakefileGenerator::OutputExecutableRule(std::ostream& fout,
|
||||||
std::string depend = "$(";
|
std::string depend = "$(";
|
||||||
depend += this->CreateMakeVariable(name, "_SRC_OBJS") + ") $(" +
|
depend += this->CreateMakeVariable(name, "_SRC_OBJS") + ") $(" +
|
||||||
this->CreateMakeVariable(name, "_DEPEND_LIBS") + ")";
|
this->CreateMakeVariable(name, "_DEPEND_LIBS") + ")";
|
||||||
std::string command =
|
std::string command;
|
||||||
"$(CMAKE_CXX_COMPILER) $(CMAKE_CXX_FLAGS) ";
|
if(t.HasCxx())
|
||||||
|
{
|
||||||
|
command = "$(CMAKE_CXX_COMPILER) $(CMAKE_CXX_FLAGS) ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
command = "${CMAKE_C_COMPILER} $(CMAKE_C_FLAGS) ";
|
||||||
|
}
|
||||||
|
bool hide_param = m_Makefile->IsOn("CMAKE_LINKER_HIDE_PARAMETERS");
|
||||||
|
if (hide_param)
|
||||||
|
{
|
||||||
|
command += " @<<\n\t";
|
||||||
|
}
|
||||||
|
|
||||||
command += "$(" + this->CreateMakeVariable(name, "_SRC_OBJS") + ") ";
|
command += "$(" + this->CreateMakeVariable(name, "_SRC_OBJS") + ") ";
|
||||||
std::string path = m_ExecutableOutputPath + name + m_ExecutableExtension;
|
std::string path = m_ExecutableOutputPath + name + m_ExecutableExtension;
|
||||||
|
|
||||||
|
@ -553,6 +566,11 @@ void cmNMakeMakefileGenerator::OutputExecutableRule(std::ostream& fout,
|
||||||
if(customCommands.size() > 0)
|
if(customCommands.size() > 0)
|
||||||
{
|
{
|
||||||
cc = customCommands.c_str();
|
cc = customCommands.c_str();
|
||||||
|
}
|
||||||
|
if (hide_param)
|
||||||
|
{
|
||||||
|
command += "\n";
|
||||||
|
command += "<<\n";
|
||||||
}
|
}
|
||||||
this->OutputMakeRule(fout,
|
this->OutputMakeRule(fout,
|
||||||
comment.c_str(),
|
comment.c_str(),
|
||||||
|
|
Loading…
Reference in New Issue