BUG: Do not crash when the link language for a target is not known.

This commit is contained in:
Brad King 2005-02-24 09:21:15 -05:00
parent 77194207ce
commit e9da9cc3d7
1 changed files with 8 additions and 0 deletions

View File

@ -1605,6 +1605,14 @@ cmLocalUnixMakefileGenerator2
const char* linkLanguage = const char* linkLanguage =
target.GetLinkerLanguage(this->GetGlobalGenerator()); target.GetLinkerLanguage(this->GetGlobalGenerator());
// Make sure we have a link language.
if(!linkLanguage)
{
cmSystemTools::Error("Cannot determine link language for target \"",
target.GetName(), "\".");
return;
}
// Build a list of compiler flags and linker flags. // Build a list of compiler flags and linker flags.
std::string flags; std::string flags;
std::string linkFlags; std::string linkFlags;