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:26 (GMT) |
commit | ca2c63f423891fcf95d3981ef1c77226d7a908e8 (patch) | |
tree | b8701b1fca28a8e7f4fe10cc4b7b87774c522ff2 /Source | |
parent | 6aff4f34d42d587732a4a8049b2711af415f632b (diff) | |
parent | cb777dd81e71746fcd324dc157d1b41f3ae3ce24 (diff) | |
download | CMake-ca2c63f423891fcf95d3981ef1c77226d7a908e8.zip CMake-ca2c63f423891fcf95d3981ef1c77226d7a908e8.tar.gz CMake-ca2c63f423891fcf95d3981ef1c77226d7a908e8.tar.bz2 |
Merge topic 'nmc-target-objects'
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 = |