XCode generation should fail if lang isn't known

This commit is contained in:
Ben Boeckel 2010-09-30 14:54:20 -04:00
parent d3a89432fd
commit 96a335fd8d
1 changed files with 10 additions and 0 deletions

View File

@ -1424,6 +1424,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
std::string defFlags; std::string defFlags;
bool shared = ((target.GetType() == cmTarget::SHARED_LIBRARY) || bool shared = ((target.GetType() == cmTarget::SHARED_LIBRARY) ||
(target.GetType() == cmTarget::MODULE_LIBRARY)); (target.GetType() == cmTarget::MODULE_LIBRARY));
bool binary = ((target.GetType() == cmTarget::STATIC_LIBRARY) ||
(target.GetType() == cmTarget::EXECUTABLE) ||
shared);
const char* lang = target.GetLinkerLanguage(configName); const char* lang = target.GetLinkerLanguage(configName);
std::string cflags; std::string cflags;
@ -1442,6 +1445,13 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// Add shared-library flags if needed. // Add shared-library flags if needed.
this->CurrentLocalGenerator->AddSharedFlags(flags, lang, shared); this->CurrentLocalGenerator->AddSharedFlags(flags, lang, shared);
} }
else if(binary)
{
cmSystemTools::Error
("CMake can not determine linker language for target:",
target.GetName());
return;
}
// Add define flags // Add define flags
this->CurrentLocalGenerator-> this->CurrentLocalGenerator->