BUG: Do not look for linker language unless it is needed.

This commit is contained in:
Brad King 2006-09-16 11:52:00 -04:00
parent 147b4ff102
commit 4a3a9eb883
1 changed files with 11 additions and 11 deletions

View File

@ -1639,17 +1639,6 @@ void cmLocalGenerator
const std::vector<std::string>& const std::vector<std::string>&
linkDirectories = target.GetLinkDirectories(); linkDirectories = target.GetLinkDirectories();
// Get the language used for linking.
const char* linkLanguage =
target.GetLinkerLanguage(this->GetGlobalGenerator());
if(!linkLanguage)
{
cmSystemTools::
Error("CMake can not determine linker language for target:",
target.GetName());
return;
}
// Lookup link type selection flags. // Lookup link type selection flags.
const char* static_link_type_flag = 0; const char* static_link_type_flag = 0;
const char* shared_link_type_flag = 0; const char* shared_link_type_flag = 0;
@ -1663,6 +1652,17 @@ void cmLocalGenerator
} }
if(target_type_str) if(target_type_str)
{ {
// Get the language used for linking.
const char* linkLanguage =
target.GetLinkerLanguage(this->GetGlobalGenerator());
if(!linkLanguage)
{
cmSystemTools::
Error("CMake can not determine linker language for target:",
target.GetName());
return;
}
std::string static_link_type_flag_var = "CMAKE_"; std::string static_link_type_flag_var = "CMAKE_";
static_link_type_flag_var += target_type_str; static_link_type_flag_var += target_type_str;
static_link_type_flag_var += "_LINK_STATIC_"; static_link_type_flag_var += "_LINK_STATIC_";