summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-15 20:06:18 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-05-15 20:06:18 (GMT)
commit4b33244ea58870ee864e7f5ce4a801d0dcb2cd3c (patch)
treeb5f478bf4c2e01ae47402ada9aade0a0fe8b3bfc /Source/cmTarget.cxx
parent93b94ce443e2fecfa0cef7edb353f76b33afd843 (diff)
downloadCMake-4b33244ea58870ee864e7f5ce4a801d0dcb2cd3c.zip
CMake-4b33244ea58870ee864e7f5ce4a801d0dcb2cd3c.tar.gz
CMake-4b33244ea58870ee864e7f5ce4a801d0dcb2cd3c.tar.bz2
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/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx27
1 files changed, 15 insertions, 12 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index a97396f..3e196f5 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;
}
}
}