summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionNode.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-04-03 18:42:35 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2019-04-19 17:52:50 (GMT)
commitce078dda79df1c8d9f142e45d2fa3cf971a09594 (patch)
treeea3941cabdb1df8f5dbefc29223f9f2bfc1e8d8d /Source/cmGeneratorExpressionNode.cxx
parent3e129d71bc12a325c0548aaaea24470cd172470b (diff)
downloadCMake-ce078dda79df1c8d9f142e45d2fa3cf971a09594.zip
CMake-ce078dda79df1c8d9f142e45d2fa3cf971a09594.tar.gz
CMake-ce078dda79df1c8d9f142e45d2fa3cf971a09594.tar.bz2
Relax the usage of TARGET_OBJECTS generator expression
The geneator expression can now be used with static, shared, and module libraries and executables.
Diffstat (limited to 'Source/cmGeneratorExpressionNode.cxx')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 50413c8..7cef1c3 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1525,10 +1525,16 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
reportError(context, content->GetOriginalExpression(), e.str());
return std::string();
}
- if (gt->GetType() != cmStateEnums::OBJECT_LIBRARY) {
+ cmStateEnums::TargetType type = gt->GetType();
+ if (type != cmStateEnums::EXECUTABLE &&
+ type != cmStateEnums::STATIC_LIBRARY &&
+ type != cmStateEnums::SHARED_LIBRARY &&
+ type != cmStateEnums::MODULE_LIBRARY &&
+ type != cmStateEnums::OBJECT_LIBRARY) {
std::ostringstream e;
e << "Objects of target \"" << tgtName
- << "\" referenced but is not an OBJECT library.";
+ << "\" referenced but is not an allowed library types (EXECUTABLE, "
+ << "STATIC, SHARED, MODULE, OBJECT).";
reportError(context, content->GetOriginalExpression(), e.str());
return std::string();
}