summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-08-10 13:13:16 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-08-10 13:13:16 (GMT)
commite8592e555fb3f19dd8a5b88948603c72b2a17a8d (patch)
treecc8d0080f4c93b965da347e8cd48574ee8b9a5af /Source
parent7979e25c8b9214a6a1097d5aa3937d6277556342 (diff)
parent35aab9df9f299d62edaa6ce611aa30614deb9e9d (diff)
downloadCMake-e8592e555fb3f19dd8a5b88948603c72b2a17a8d.zip
CMake-e8592e555fb3f19dd8a5b88948603c72b2a17a8d.tar.gz
CMake-e8592e555fb3f19dd8a5b88948603c72b2a17a8d.tar.bz2
Merge topic 'fix-TARGET_FILE-imported'
35aab9df Reject TARGET_PDB_FILE for imported targets instead of crashing
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)
{