summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionNode.cxx
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/cmGeneratorExpressionNode.cxx
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/cmGeneratorExpressionNode.cxx')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx7
1 files changed, 7 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";