diff options
author | Brad King <brad.king@kitware.com> | 2021-07-23 13:38:31 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-07-23 13:39:25 (GMT) |
commit | e06c60f7e9b663b55f26cbebeee89cc73cdeffc9 (patch) | |
tree | a5b0d688452e9da19489ae9374543ce8ed62053f /Source | |
parent | 8ea0691e624c0271eb31fd4afb9a365256849c12 (diff) | |
parent | cb777dd81e71746fcd324dc157d1b41f3ae3ce24 (diff) | |
download | CMake-e06c60f7e9b663b55f26cbebeee89cc73cdeffc9.zip CMake-e06c60f7e9b663b55f26cbebeee89cc73cdeffc9.tar.gz CMake-e06c60f7e9b663b55f26cbebeee89cc73cdeffc9.tar.bz2 |
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.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index c608bf9..217ebe5 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 = |