ENH: some better error reporting and more robust handlign of bad targets

This commit is contained in:
Andy Cedilnik 2005-06-09 09:48:44 -04:00
parent a7fcb07418
commit 2d4b06c8e5
2 changed files with 12 additions and 7 deletions

View File

@ -704,7 +704,9 @@ cmGlobalUnixMakefileGenerator3
{ {
// Don't emit the same rule twice (e.g. two targets with the same // Don't emit the same rule twice (e.g. two targets with the same
// simple name) // simple name)
if(emitted.insert(t->second.GetName()).second) if(t->second.GetName() &&
strlen(t->second.GetName()) &&
emitted.insert(t->second.GetName()).second)
{ {
// Add a rule to build the target by name. // Add a rule to build the target by name.
lg->WriteDivider(ruleFileStream); lg->WriteDivider(ruleFileStream);
@ -749,11 +751,13 @@ cmGlobalUnixMakefileGenerator3
bool needRequiresStep = this->NeedRequiresStep(lg); bool needRequiresStep = this->NeedRequiresStep(lg);
for(cmTargets::const_iterator t = targets.begin(); t != targets.end(); ++t) for(cmTargets::const_iterator t = targets.begin(); t != targets.end(); ++t)
{ {
if((t->second.GetType() == cmTarget::EXECUTABLE) || if (((t->second.GetType() == cmTarget::EXECUTABLE) ||
(t->second.GetType() == cmTarget::STATIC_LIBRARY) || (t->second.GetType() == cmTarget::STATIC_LIBRARY) ||
(t->second.GetType() == cmTarget::SHARED_LIBRARY) || (t->second.GetType() == cmTarget::SHARED_LIBRARY) ||
(t->second.GetType() == cmTarget::MODULE_LIBRARY) || (t->second.GetType() == cmTarget::MODULE_LIBRARY) ||
(t->second.GetType() == cmTarget::UTILITY)) (t->second.GetType() == cmTarget::UTILITY)) &&
t->second.GetName() &&
strlen(t->second.GetName()))
{ {
// Add a rule to build the target by name. // Add a rule to build the target by name.
localName = lg->GetRelativeTargetDirectory(t->second); localName = lg->GetRelativeTargetDirectory(t->second);

View File

@ -864,7 +864,8 @@ cmLocalUnixMakefileGenerator3
// Make sure there is a target. // Make sure there is a target.
if(!target || !*target) if(!target || !*target)
{ {
cmSystemTools::Error("No target for WriteMakeRule!"); cmSystemTools::Error("No target for WriteMakeRule! called with comment: ",
comment);
return; return;
} }