summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-08-03 19:28:41 (GMT)
committerBrad King <brad.king@kitware.com>2015-08-06 13:42:31 (GMT)
commit35aab9df9f299d62edaa6ce611aa30614deb9e9d (patch)
treeb814a438e4e05b23807dd2ffd6dd8a26091f8cdb /Source
parent22590805bffe74c3b4998152556561a2c2b6d177 (diff)
downloadCMake-35aab9df9f299d62edaa6ce611aa30614deb9e9d.zip
CMake-35aab9df9f299d62edaa6ce611aa30614deb9e9d.tar.gz
CMake-35aab9df9f299d62edaa6ce611aa30614deb9e9d.tar.bz2
Reject TARGET_PDB_FILE for imported targets instead of crashing
Reported-by: Justin Borodinsky <justin.borodinsky@gmail.com>
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx7
-rw-r--r--Source/cmGeneratorTarget.cxx1
2 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index a86c2bc..44a9adb 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1600,6 +1600,13 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
cmGeneratorExpressionContext *context,
const GeneratorExpressionContent *content)
{
+ if (target->IsImported())
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "TARGET_PDB_FILE not allowed for IMPORTED targets.");
+ return std::string();
+ }
+
std::string language = target->GetLinkerLanguage(context->Config);
std::string pdbSupportVar = "CMAKE_" + language + "_LINKER_SUPPORTS_PDB";
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c831704..e490368 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1248,6 +1248,7 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config,
UNORDERED_SET<std::string> languages;
cmTarget::LinkImplementation const* impl =
this->Target->GetLinkImplementation(config);
+ assert(impl);
for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
li != impl->Languages.end(); ++li)
{