summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-08-21 13:45:13 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-08-21 13:45:13 (GMT)
commit5be8fa451a07a51c39670ed59e8c25f7441cceda (patch)
treec90967ee70011f4694ae806c97ae4648194f50ea
parent4380c3b0f1eb398d3608321efce01577d2968f29 (diff)
downloadCMake-5be8fa451a07a51c39670ed59e8c25f7441cceda.zip
CMake-5be8fa451a07a51c39670ed59e8c25f7441cceda.tar.gz
CMake-5be8fa451a07a51c39670ed59e8c25f7441cceda.tar.bz2
BUG: use c compiler for link of c programs, and use temp file nmake syntax for linking c and c++ programs
-rw-r--r--Source/cmNMakeMakefileGenerator.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/Source/cmNMakeMakefileGenerator.cxx b/Source/cmNMakeMakefileGenerator.cxx
index 2637131..0e0b8ea 100644
--- a/Source/cmNMakeMakefileGenerator.cxx
+++ b/Source/cmNMakeMakefileGenerator.cxx
@@ -521,8 +521,21 @@ void cmNMakeMakefileGenerator::OutputExecutableRule(std::ostream& fout,
std::string depend = "$(";
depend += this->CreateMakeVariable(name, "_SRC_OBJS") + ") $(" +
this->CreateMakeVariable(name, "_DEPEND_LIBS") + ")";
- std::string command =
- "$(CMAKE_CXX_COMPILER) $(CMAKE_CXX_FLAGS) ";
+ std::string command;
+ 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") + ") ";
std::string path = m_ExecutableOutputPath + name + m_ExecutableExtension;
@@ -553,6 +566,11 @@ void cmNMakeMakefileGenerator::OutputExecutableRule(std::ostream& fout,
if(customCommands.size() > 0)
{
cc = customCommands.c_str();
+ }
+ if (hide_param)
+ {
+ command += "\n";
+ command += "<<\n";
}
this->OutputMakeRule(fout,
comment.c_str(),