mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 12:19:54 -05:00
cmGeneratorExpression: Add comments on implementation details
Clarify the purpose of some genex code that collects properties over the transitive link closure.
This commit is contained in:
@@ -141,12 +141,15 @@ bool cmGeneratorExpressionDAGChecker::GetTransitivePropertiesOnlyCMP0131()
|
|||||||
|
|
||||||
bool cmGeneratorExpressionDAGChecker::EvaluatingGenexExpression() const
|
bool cmGeneratorExpressionDAGChecker::EvaluatingGenexExpression() const
|
||||||
{
|
{
|
||||||
|
// Corresponds to GenexEvaluator::EvaluateExpression.
|
||||||
return cmHasLiteralPrefix(this->Property, "TARGET_GENEX_EVAL:") ||
|
return cmHasLiteralPrefix(this->Property, "TARGET_GENEX_EVAL:") ||
|
||||||
cmHasLiteralPrefix(this->Property, "GENEX_EVAL:");
|
cmHasLiteralPrefix(this->Property, "GENEX_EVAL:");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmGeneratorExpressionDAGChecker::EvaluatingPICExpression() const
|
bool cmGeneratorExpressionDAGChecker::EvaluatingPICExpression() const
|
||||||
{
|
{
|
||||||
|
// Corresponds to checkInterfacePropertyCompatibility's special case
|
||||||
|
// that evaluates the value of POSITION_INDEPENDENT_CODE as a genex.
|
||||||
return this->Top->Property == "INTERFACE_POSITION_INDEPENDENT_CODE";
|
return this->Top->Property == "INTERFACE_POSITION_INDEPENDENT_CODE";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -547,6 +547,7 @@ static const struct TargetGenexEvalNode : public GenexEvaluator
|
|||||||
return expression;
|
return expression;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace the surrounding context with the named target.
|
||||||
cmGeneratorExpressionContext targetContext(
|
cmGeneratorExpressionContext targetContext(
|
||||||
context->LG, context->Config, context->Quiet, target, target,
|
context->LG, context->Config, context->Quiet, target, target,
|
||||||
context->EvaluateForBuildsystem, context->Backtrace, context->Language);
|
context->EvaluateForBuildsystem, context->Backtrace, context->Language);
|
||||||
@@ -2897,6 +2898,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
|||||||
bool evaluatingLinkLibraries = false;
|
bool evaluatingLinkLibraries = false;
|
||||||
|
|
||||||
if (dagCheckerParent) {
|
if (dagCheckerParent) {
|
||||||
|
// This $<TARGET_PROPERTY:...> node has been reached while evaluating
|
||||||
|
// another target property value. Check that the outermost evaluation
|
||||||
|
// expects such nested evaluations.
|
||||||
if (dagCheckerParent->EvaluatingGenexExpression() ||
|
if (dagCheckerParent->EvaluatingGenexExpression() ||
|
||||||
dagCheckerParent->EvaluatingPICExpression() ||
|
dagCheckerParent->EvaluatingPICExpression() ||
|
||||||
dagCheckerParent->EvaluatingLinkerLauncher()) {
|
dagCheckerParent->EvaluatingLinkerLauncher()) {
|
||||||
|
|||||||
@@ -6375,6 +6375,7 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
|
|||||||
std::string interfaceProperty = "INTERFACE_" + p;
|
std::string interfaceProperty = "INTERFACE_" + p;
|
||||||
std::unique_ptr<cmGeneratorExpressionInterpreter> genexInterpreter;
|
std::unique_ptr<cmGeneratorExpressionInterpreter> genexInterpreter;
|
||||||
if (p == "POSITION_INDEPENDENT_CODE") {
|
if (p == "POSITION_INDEPENDENT_CODE") {
|
||||||
|
// Corresponds to EvaluatingPICExpression.
|
||||||
genexInterpreter = cm::make_unique<cmGeneratorExpressionInterpreter>(
|
genexInterpreter = cm::make_unique<cmGeneratorExpressionInterpreter>(
|
||||||
tgt->GetLocalGenerator(), config, tgt);
|
tgt->GetLocalGenerator(), config, tgt);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user