1
0
Эх сурвалжийг харах

cmGeneratorExpressionNode: Factor out local variable for global generator

Brad King 4 жил өмнө
parent
commit
83c8272280

+ 4 - 3
Source/cmGeneratorExpressionNode.cxx

@@ -1635,10 +1635,11 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
       reportError(context, content->GetOriginalExpression(), e.str());
       reportError(context, content->GetOriginalExpression(), e.str());
       return std::string();
       return std::string();
     }
     }
-    if (!context->EvaluateForBuildsystem) {
-      cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+    cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+    {
       std::string reason;
       std::string reason;
-      if (!gg->HasKnownObjectFileLocation(&reason)) {
+      if (!context->EvaluateForBuildsystem &&
+          !gg->HasKnownObjectFileLocation(&reason)) {
         std::ostringstream e;
         std::ostringstream e;
         e << "The evaluation of the TARGET_OBJECTS generator expression "
         e << "The evaluation of the TARGET_OBJECTS generator expression "
              "is only suitable for consumption by CMake (limited"
              "is only suitable for consumption by CMake (limited"