summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-23 13:38:31 +0000
committerKitware Robot <kwrobot@kitware.com>2021-07-23 09:39:25 -0400
commite06c60f7e9b663b55f26cbebeee89cc73cdeffc9 (patch)
treea5b0d688452e9da19489ae9374543ce8ed62053f /Source
parent8ea0691e624c0271eb31fd4afb9a365256849c12 (diff)
parentcb777dd81e71746fcd324dc157d1b41f3ae3ce24 (diff)
downloadcmake-e06c60f7e9b663b55f26cbebeee89cc73cdeffc9.tar.gz
Merge topic 'nmc-target-objects' into release-3.21
cb777dd81e Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs 83c8272280 cmGeneratorExpressionNode: Factor out local variable for global generator Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6371
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index c608bf940d..217ebe5f9d 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1635,10 +1635,11 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
reportError(context, content->GetOriginalExpression(), e.str());
return std::string();
}
- if (!context->EvaluateForBuildsystem) {
- cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+ cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+ {
std::string reason;
- if (!gg->HasKnownObjectFileLocation(&reason)) {
+ if (!context->EvaluateForBuildsystem &&
+ !gg->HasKnownObjectFileLocation(&reason)) {
std::ostringstream e;
e << "The evaluation of the TARGET_OBJECTS generator expression "
"is only suitable for consumption by CMake (limited"
@@ -1664,7 +1665,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
gt->GetTargetObjectNames(context->Config, objects);
std::string obj_dir;
- if (context->EvaluateForBuildsystem) {
+ if (context->EvaluateForBuildsystem && !gg->SupportsCrossConfigs()) {
// Use object file directory with buildsystem placeholder.
obj_dir = gt->ObjectDirectory;
context->HadContextSensitiveCondition =