From 6ff1579ba7501da1f9ab677f9a506c75e6ff8a55 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 25 Sep 2002 09:31:13 -0400 Subject: [PATCH] Use file format detection --- Source/cmLocalUnixMakefileGenerator.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 2e6bdb7f3..536c12e7b 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -1890,8 +1890,9 @@ OutputBuildObjectFromSource(std::ostream& fout, comment += objectFile + " From "; comment += source.GetFullPath(); std::string compileCommand; - std::string ext = source.GetSourceExtension(); - if(ext == "c" ) + cmSystemTools::e_FileFormat format = + cmSystemTools::GetFileFormat(source.GetSourceExtension().c_str()); + if( format == cmSystemTools::C_FILE_FORMAT ) { compileCommand = "$(CMAKE_C_COMPILER) $(CMAKE_C_FLAGS) "; compileCommand += extraCompileFlags; @@ -1905,7 +1906,7 @@ OutputBuildObjectFromSource(std::ostream& fout, compileCommand += " -o "; compileCommand += objectFile; } - else + else if ( format == cmSystemTools::CXX_FILE_FORMAT ) { compileCommand = "$(CMAKE_CXX_COMPILER) $(CMAKE_CXX_FLAGS) "; compileCommand += extraCompileFlags;