GenEx: Collect evaluation arguments into local Context structures

This commit is contained in:
Brad King
2025-09-21 11:39:02 -04:00
parent b40a53e931
commit d4d204382f
19 changed files with 255 additions and 187 deletions

View File

@@ -11,6 +11,7 @@
#include <cmext/string_view>
#include "cmComputeLinkInformation.h"
#include "cmGenExContext.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorExpressionDAGChecker.h"
#include "cmGeneratorTarget.h"
@@ -521,13 +522,14 @@ std::string cmCommonTargetGenerator::GetLinkerLauncher(
std::string propName = lang + "_LINKER_LAUNCHER";
cmValue launcherProp = this->GeneratorTarget->GetProperty(propName);
if (cmNonempty(launcherProp)) {
cm::GenEx::Context context(this->LocalCommonGenerator, config, lang);
cmGeneratorExpressionDAGChecker dagChecker{
this->GeneratorTarget, propName, nullptr, nullptr,
this->LocalCommonGenerator, config,
this->GeneratorTarget, propName, nullptr, nullptr, context.LG,
context.Config
};
std::string evaluatedLinklauncher = cmGeneratorExpression::Evaluate(
*launcherProp, this->LocalCommonGenerator, config, this->GeneratorTarget,
&dagChecker, this->GeneratorTarget, lang);
*launcherProp, context.LG, context.Config, this->GeneratorTarget,
&dagChecker, this->GeneratorTarget, context.Language);
// Convert ;-delimited list to single string
cmList args{ evaluatedLinklauncher, cmList::EmptyElements::Yes };
if (!args.empty()) {