From 5be8fa451a07a51c39670ed59e8c25f7441cceda Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 21 Aug 2002 09:45:13 -0400 Subject: [PATCH] BUG: use c compiler for link of c programs, and use temp file nmake syntax for linking c and c++ programs --- Source/cmNMakeMakefileGenerator.cxx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Source/cmNMakeMakefileGenerator.cxx b/Source/cmNMakeMakefileGenerator.cxx index 2637131b9..0e0b8ea58 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(),