summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-15 16:06:18 -0400
committerAlexander Neundorf <neundorf@kde.org>2007-05-15 16:06:18 -0400
commit4b33244ea58870ee864e7f5ce4a801d0dcb2cd3c (patch)
treeb5f478bf4c2e01ae47402ada9aade0a0fe8b3bfc /Source
parent93b94ce443e2fecfa0cef7edb353f76b33afd843 (diff)
downloadcmake-4b33244ea58870ee864e7f5ce4a801d0dcb2cd3c.tar.gz
BUG: fix segfault when trying to get the object file for a sourcefile in an
unknown language via GET_TARGET_PROPERTY(), as reported by Trevor Kellaway Alex
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx27
1 files changed, 15 insertions, 12 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index a97396f07b..3e196f5b57 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1303,21 +1303,24 @@ void cmTarget::ComputeObjectFiles()
const char* lang = this->Makefile->GetLocalGenerator()->
GetGlobalGenerator()->
GetLanguageFromExtension(sf->GetSourceExtension().c_str());
- std::string lookupObj = objExtensionLookup1 + lang;
- lookupObj += objExtensionLookup2;
- const char* obj = this->Makefile->GetDefinition(lookupObj.c_str());
- if(obj)
+ if (lang)
{
- if(objectFiles.size())
+ std::string lookupObj = objExtensionLookup1 + lang;
+ lookupObj += objExtensionLookup2;
+ const char* obj = this->Makefile->GetDefinition(lookupObj.c_str());
+ if(obj)
{
- objectFiles += ";";
+ if(objectFiles.size())
+ {
+ objectFiles += ";";
+ }
+ std::string objFile = *d;
+ objFile += "/";
+ objFile += this->Makefile->GetLocalGenerator()->
+ GetSourceObjectName(*sf);
+ objFile += obj;
+ objectFiles += objFile;
}
- std::string objFile = *d;
- objFile += "/";
- objFile += this->Makefile->GetLocalGenerator()->
- GetSourceObjectName(*sf);
- objFile += obj;
- objectFiles += objFile;
}
}
}