mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Genex: Reject TARGET_OBJECTS on non-object libraries earlier
Move the diagnostic that rejects the TARGET_OBJECTS generator expression in non-buildsystem context until after the check for whether the named target is an object library. This order will makes more sense than the previous order once TARGET_OBJECTS is allowed in non-buildsystem context.
This commit is contained in:
@@ -1226,15 +1226,6 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
|
||||
cmGeneratorExpressionDAGChecker* /*dagChecker*/) const
|
||||
CM_OVERRIDE
|
||||
{
|
||||
if (!context->EvaluateForBuildsystem) {
|
||||
std::ostringstream e;
|
||||
e << "The evaluation of the TARGET_OBJECTS generator expression "
|
||||
"is only suitable for consumption by CMake. It is not suitable "
|
||||
"for writing out elsewhere.";
|
||||
reportError(context, content->GetOriginalExpression(), e.str());
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string tgtName = parameters.front();
|
||||
cmGeneratorTarget* gt = context->LG->FindGeneratorTargetToUse(tgtName);
|
||||
if (!gt) {
|
||||
@@ -1251,6 +1242,14 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
|
||||
reportError(context, content->GetOriginalExpression(), e.str());
|
||||
return std::string();
|
||||
}
|
||||
if (!context->EvaluateForBuildsystem) {
|
||||
std::ostringstream e;
|
||||
e << "The evaluation of the TARGET_OBJECTS generator expression "
|
||||
"is only suitable for consumption by CMake. It is not suitable "
|
||||
"for writing out elsewhere.";
|
||||
reportError(context, content->GetOriginalExpression(), e.str());
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::vector<std::string> objects;
|
||||
gt->GetTargetObjectNames(context->Config, objects);
|
||||
|
||||
Reference in New Issue
Block a user