diff options
author | Brad King <brad.king@kitware.com> | 2015-08-10 13:13:16 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-08-10 13:13:16 (GMT) |
commit | e8592e555fb3f19dd8a5b88948603c72b2a17a8d (patch) | |
tree | cc8d0080f4c93b965da347e8cd48574ee8b9a5af /Source | |
parent | 7979e25c8b9214a6a1097d5aa3937d6277556342 (diff) | |
parent | 35aab9df9f299d62edaa6ce611aa30614deb9e9d (diff) | |
download | CMake-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.cxx | 7 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 1 |
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) { |