Use file format detection

This commit is contained in:
Andy Cedilnik 2002-09-25 09:31:13 -04:00
parent 6736678ca3
commit 6ff1579ba7

View File

@ -1890,8 +1890,9 @@ OutputBuildObjectFromSource(std::ostream& fout,
comment += objectFile + " From "; comment += objectFile + " From ";
comment += source.GetFullPath(); comment += source.GetFullPath();
std::string compileCommand; std::string compileCommand;
std::string ext = source.GetSourceExtension(); cmSystemTools::e_FileFormat format =
if(ext == "c" ) cmSystemTools::GetFileFormat(source.GetSourceExtension().c_str());
if( format == cmSystemTools::C_FILE_FORMAT )
{ {
compileCommand = "$(CMAKE_C_COMPILER) $(CMAKE_C_FLAGS) "; compileCommand = "$(CMAKE_C_COMPILER) $(CMAKE_C_FLAGS) ";
compileCommand += extraCompileFlags; compileCommand += extraCompileFlags;
@ -1905,7 +1906,7 @@ OutputBuildObjectFromSource(std::ostream& fout,
compileCommand += " -o "; compileCommand += " -o ";
compileCommand += objectFile; compileCommand += objectFile;
} }
else else if ( format == cmSystemTools::CXX_FILE_FORMAT )
{ {
compileCommand = "$(CMAKE_CXX_COMPILER) $(CMAKE_CXX_FLAGS) "; compileCommand = "$(CMAKE_CXX_COMPILER) $(CMAKE_CXX_FLAGS) ";
compileCommand += extraCompileFlags; compileCommand += extraCompileFlags;