From e9da9cc3d7b7c710aa0960e6cabd85d5d878bc76 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 24 Feb 2005 09:21:15 -0500 Subject: [PATCH] BUG: Do not crash when the link language for a target is not known. --- Source/cmLocalUnixMakefileGenerator2.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/cmLocalUnixMakefileGenerator2.cxx b/Source/cmLocalUnixMakefileGenerator2.cxx index 400c3be5d..a8023e505 100644 --- a/Source/cmLocalUnixMakefileGenerator2.cxx +++ b/Source/cmLocalUnixMakefileGenerator2.cxx @@ -1605,6 +1605,14 @@ cmLocalUnixMakefileGenerator2 const char* linkLanguage = 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. std::string flags; std::string linkFlags;