Merge topic 'genex-consumers-generator-targets'
c4ae1578
Genex: Port some access API to cmGeneratorTarget.6d27a3db
Genex: Port implementation to cmGeneratorTarget.
This commit is contained in:
commit
dfd371dc01
|
@ -84,13 +84,14 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
|
||||||
false, &gDummyHead,
|
false, &gDummyHead,
|
||||||
gtgt, &dagChecker);
|
gtgt, &dagChecker);
|
||||||
|
|
||||||
const std::set<cmTarget const*> &allTargets = cge->GetAllTargetsSeen();
|
const std::set<cmGeneratorTarget const*> &allTargets =
|
||||||
for(std::set<cmTarget const*>::const_iterator li = allTargets.begin();
|
cge->GetAllTargetsSeen();
|
||||||
li != allTargets.end(); ++li)
|
for(std::set<cmGeneratorTarget const*>::const_iterator li =
|
||||||
|
allTargets.begin(); li != allTargets.end(); ++li)
|
||||||
{
|
{
|
||||||
if(emitted.insert(*li).second)
|
if(emitted.insert((*li)->Target).second)
|
||||||
{
|
{
|
||||||
this->Exports.push_back(*li);
|
this->Exports.push_back((*li)->Target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -11,10 +11,9 @@
|
||||||
============================================================================*/
|
============================================================================*/
|
||||||
#include "cmGeneratorExpression.h"
|
#include "cmGeneratorExpression.h"
|
||||||
|
|
||||||
#include "cmMakefile.h"
|
|
||||||
#include "cmTarget.h"
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "cmAlgorithms.h"
|
#include "cmAlgorithms.h"
|
||||||
|
#include "cmSystemTools.h"
|
||||||
|
|
||||||
#include "cmGeneratorExpressionEvaluator.h"
|
#include "cmGeneratorExpressionEvaluator.h"
|
||||||
#include "cmGeneratorExpressionLexer.h"
|
#include "cmGeneratorExpressionLexer.h"
|
||||||
|
@ -463,10 +462,11 @@ bool cmGeneratorExpression::IsValidTargetName(const std::string &input)
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void
|
void
|
||||||
cmCompiledGeneratorExpression::GetMaxLanguageStandard(cmTarget const* tgt,
|
cmCompiledGeneratorExpression::GetMaxLanguageStandard(
|
||||||
|
const cmGeneratorTarget* tgt,
|
||||||
std::map<std::string, std::string>& mapping)
|
std::map<std::string, std::string>& mapping)
|
||||||
{
|
{
|
||||||
typedef std::map<cmTarget const*,
|
typedef std::map<cmGeneratorTarget const*,
|
||||||
std::map<std::string, std::string> > MapType;
|
std::map<std::string, std::string> > MapType;
|
||||||
MapType::const_iterator it = this->MaxLanguageStandard.find(tgt);
|
MapType::const_iterator it = this->MaxLanguageStandard.find(tgt);
|
||||||
if (it != this->MaxLanguageStandard.end())
|
if (it != this->MaxLanguageStandard.end())
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include <cmsys/RegularExpression.hxx>
|
#include <cmsys/RegularExpression.hxx>
|
||||||
#include <cmsys/auto_ptr.hxx>
|
#include <cmsys/auto_ptr.hxx>
|
||||||
|
|
||||||
class cmTarget;
|
|
||||||
class cmGeneratorTarget;
|
class cmGeneratorTarget;
|
||||||
class cmLocalGenerator;
|
class cmLocalGenerator;
|
||||||
class cmListFileBacktrace;
|
class cmListFileBacktrace;
|
||||||
|
@ -92,13 +91,13 @@ public:
|
||||||
std::string const& language = std::string()) const;
|
std::string const& language = std::string()) const;
|
||||||
|
|
||||||
/** Get set of targets found during evaluations. */
|
/** Get set of targets found during evaluations. */
|
||||||
std::set<cmTarget*> const& GetTargets() const
|
std::set<cmGeneratorTarget*> const& GetTargets() const
|
||||||
{ return this->DependTargets; }
|
{ return this->DependTargets; }
|
||||||
|
|
||||||
std::set<std::string> const& GetSeenTargetProperties() const
|
std::set<std::string> const& GetSeenTargetProperties() const
|
||||||
{ return this->SeenTargetProperties; }
|
{ return this->SeenTargetProperties; }
|
||||||
|
|
||||||
std::set<cmTarget const*> const& GetAllTargetsSeen() const
|
std::set<cmGeneratorTarget const*> const& GetAllTargetsSeen() const
|
||||||
{ return this->AllTargetsSeen; }
|
{ return this->AllTargetsSeen; }
|
||||||
|
|
||||||
~cmCompiledGeneratorExpression();
|
~cmCompiledGeneratorExpression();
|
||||||
|
@ -120,7 +119,7 @@ public:
|
||||||
{
|
{
|
||||||
return this->HadHeadSensitiveCondition;
|
return this->HadHeadSensitiveCondition;
|
||||||
}
|
}
|
||||||
std::set<cmTarget const*> GetSourceSensitiveTargets() const
|
std::set<cmGeneratorTarget const*> GetSourceSensitiveTargets() const
|
||||||
{
|
{
|
||||||
return this->SourceSensitiveTargets;
|
return this->SourceSensitiveTargets;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +129,7 @@ public:
|
||||||
this->EvaluateForBuildsystem = eval;
|
this->EvaluateForBuildsystem = eval;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetMaxLanguageStandard(cmTarget const* tgt,
|
void GetMaxLanguageStandard(cmGeneratorTarget const* tgt,
|
||||||
std::map<std::string, std::string>& mapping);
|
std::map<std::string, std::string>& mapping);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -150,15 +149,15 @@ private:
|
||||||
const std::string Input;
|
const std::string Input;
|
||||||
bool NeedsEvaluation;
|
bool NeedsEvaluation;
|
||||||
|
|
||||||
mutable std::set<cmTarget*> DependTargets;
|
mutable std::set<cmGeneratorTarget*> DependTargets;
|
||||||
mutable std::set<cmTarget const*> AllTargetsSeen;
|
mutable std::set<cmGeneratorTarget const*> AllTargetsSeen;
|
||||||
mutable std::set<std::string> SeenTargetProperties;
|
mutable std::set<std::string> SeenTargetProperties;
|
||||||
mutable std::map<cmTarget const*, std::map<std::string, std::string> >
|
mutable std::map<cmGeneratorTarget const*,
|
||||||
MaxLanguageStandard;
|
std::map<std::string, std::string> > MaxLanguageStandard;
|
||||||
mutable std::string Output;
|
mutable std::string Output;
|
||||||
mutable bool HadContextSensitiveCondition;
|
mutable bool HadContextSensitiveCondition;
|
||||||
mutable bool HadHeadSensitiveCondition;
|
mutable bool HadHeadSensitiveCondition;
|
||||||
mutable std::set<cmTarget const*> SourceSensitiveTargets;
|
mutable std::set<cmGeneratorTarget const*> SourceSensitiveTargets;
|
||||||
bool EvaluateForBuildsystem;
|
bool EvaluateForBuildsystem;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ cmGeneratorExpressionContext::cmGeneratorExpressionContext(
|
||||||
LG(lg),
|
LG(lg),
|
||||||
Config(config),
|
Config(config),
|
||||||
Language(language),
|
Language(language),
|
||||||
HeadTarget(headTarget ? headTarget->Target : 0),
|
HeadTarget(headTarget),
|
||||||
CurrentTarget(currentTarget ? currentTarget->Target : 0),
|
CurrentTarget(currentTarget),
|
||||||
Quiet(quiet),
|
Quiet(quiet),
|
||||||
HadError(false),
|
HadError(false),
|
||||||
HadContextSensitiveCondition(false),
|
HadContextSensitiveCondition(false),
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class cmTarget;
|
|
||||||
class cmGeneratorTarget;
|
class cmGeneratorTarget;
|
||||||
class cmLocalGenerator;
|
class cmLocalGenerator;
|
||||||
|
|
||||||
|
@ -34,18 +33,20 @@ struct cmGeneratorExpressionContext
|
||||||
|
|
||||||
|
|
||||||
cmListFileBacktrace Backtrace;
|
cmListFileBacktrace Backtrace;
|
||||||
std::set<cmTarget*> DependTargets;
|
std::set<cmGeneratorTarget*> DependTargets;
|
||||||
std::set<cmTarget const*> AllTargets;
|
std::set<cmGeneratorTarget const*> AllTargets;
|
||||||
std::set<std::string> SeenTargetProperties;
|
std::set<std::string> SeenTargetProperties;
|
||||||
std::set<cmTarget const*> SourceSensitiveTargets;
|
std::set<cmGeneratorTarget const*> SourceSensitiveTargets;
|
||||||
std::map<cmTarget const*, std::map<std::string, std::string> >
|
std::map<cmGeneratorTarget const*, std::map<std::string, std::string> >
|
||||||
MaxLanguageStandard;
|
MaxLanguageStandard;
|
||||||
cmLocalGenerator *LG;
|
cmLocalGenerator *LG;
|
||||||
std::string Config;
|
std::string Config;
|
||||||
std::string Language;
|
std::string Language;
|
||||||
cmTarget const* HeadTarget; // The target whose property is being evaluated.
|
// The target whose property is being evaluated.
|
||||||
cmTarget const* CurrentTarget; // The dependent of HeadTarget which appears
|
cmGeneratorTarget const* HeadTarget;
|
||||||
// directly or indirectly in the property.
|
// The dependent of HeadTarget which appears
|
||||||
|
// directly or indirectly in the property.
|
||||||
|
cmGeneratorTarget const* CurrentTarget;
|
||||||
bool Quiet;
|
bool Quiet;
|
||||||
bool HadError;
|
bool HadError;
|
||||||
bool HadContextSensitiveCondition;
|
bool HadContextSensitiveCondition;
|
||||||
|
|
|
@ -705,7 +705,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
|
||||||
const char* loc = 0;
|
const char* loc = 0;
|
||||||
const char* imp = 0;
|
const char* imp = 0;
|
||||||
std::string suffix;
|
std::string suffix;
|
||||||
if (context->CurrentTarget->GetMappedConfig(context->Config,
|
if (context->CurrentTarget->Target->GetMappedConfig(context->Config,
|
||||||
&loc,
|
&loc,
|
||||||
&imp,
|
&imp,
|
||||||
suffix))
|
suffix))
|
||||||
|
@ -893,7 +893,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
}
|
}
|
||||||
static cmsys::RegularExpression propertyNameValidator("^[A-Za-z0-9_]+$");
|
static cmsys::RegularExpression propertyNameValidator("^[A-Za-z0-9_]+$");
|
||||||
|
|
||||||
cmTarget const* target = context->HeadTarget;
|
cmGeneratorTarget const* target = context->HeadTarget;
|
||||||
std::string propertyName = *parameters.begin();
|
std::string propertyName = *parameters.begin();
|
||||||
|
|
||||||
if (parameters.size() == 1)
|
if (parameters.size() == 1)
|
||||||
|
@ -945,15 +945,15 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
{
|
{
|
||||||
if(context->LG->GetMakefile()->IsAlias(targetName))
|
if(context->LG->GetMakefile()->IsAlias(targetName))
|
||||||
{
|
{
|
||||||
if(cmTarget* tgt =
|
if(cmGeneratorTarget* tgt =
|
||||||
context->LG->GetMakefile()->FindTargetToUse(targetName))
|
context->LG->FindGeneratorTargetToUse(targetName))
|
||||||
{
|
{
|
||||||
return tgt->GetName();
|
return tgt->GetName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
target = context->LG->GetMakefile()->FindTargetToUse(targetName);
|
target = context->LG->FindGeneratorTargetToUse(targetName);
|
||||||
|
|
||||||
if (!target)
|
if (!target)
|
||||||
{
|
{
|
||||||
|
@ -997,12 +997,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
|
|
||||||
assert(target);
|
assert(target);
|
||||||
|
|
||||||
cmGeneratorTarget* gtgt =
|
|
||||||
context->LG->GetGlobalGenerator()->GetGeneratorTarget(target);
|
|
||||||
|
|
||||||
if (propertyName == "LINKER_LANGUAGE")
|
if (propertyName == "LINKER_LANGUAGE")
|
||||||
{
|
{
|
||||||
if (target->LinkLanguagePropagatesToDependents() &&
|
if (target->Target->LinkLanguagePropagatesToDependents() &&
|
||||||
dagCheckerParent && (dagCheckerParent->EvaluatingLinkLibraries()
|
dagCheckerParent && (dagCheckerParent->EvaluatingLinkLibraries()
|
||||||
|| dagCheckerParent->EvaluatingSources()))
|
|| dagCheckerParent->EvaluatingSources()))
|
||||||
{
|
{
|
||||||
|
@ -1011,7 +1008,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
"link libraries for a static library");
|
"link libraries for a static library");
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
return gtgt->GetLinkerLanguage(context->Config);
|
return target->GetLinkerLanguage(context->Config);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmGeneratorExpressionDAGChecker dagChecker(context->Backtrace,
|
cmGeneratorExpressionDAGChecker dagChecker(context->Backtrace,
|
||||||
|
@ -1110,20 +1107,18 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#undef POPULATE_INTERFACE_PROPERTY_NAME
|
#undef POPULATE_INTERFACE_PROPERTY_NAME
|
||||||
cmTarget const* headTarget = context->HeadTarget && isInterfaceProperty
|
cmGeneratorTarget const* headTarget =
|
||||||
|
context->HeadTarget && isInterfaceProperty
|
||||||
? context->HeadTarget : target;
|
? context->HeadTarget : target;
|
||||||
|
|
||||||
if(isInterfaceProperty)
|
if(isInterfaceProperty)
|
||||||
{
|
{
|
||||||
cmGeneratorTarget* gHeadTarget =
|
|
||||||
context->LG->GetGlobalGenerator()
|
|
||||||
->GetGeneratorTarget(headTarget);
|
|
||||||
if(cmLinkInterfaceLibraries const* iface =
|
if(cmLinkInterfaceLibraries const* iface =
|
||||||
gtgt->GetLinkInterfaceLibraries(context->Config, gHeadTarget, true))
|
target->GetLinkInterfaceLibraries(context->Config, headTarget, true))
|
||||||
{
|
{
|
||||||
linkedTargetsContent =
|
linkedTargetsContent =
|
||||||
getLinkedTargetsContent(iface->Libraries, gtgt,
|
getLinkedTargetsContent(iface->Libraries, target,
|
||||||
gHeadTarget,
|
headTarget,
|
||||||
context, &dagChecker,
|
context, &dagChecker,
|
||||||
interfacePropertyName);
|
interfacePropertyName);
|
||||||
}
|
}
|
||||||
|
@ -1131,11 +1126,11 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
else if(!interfacePropertyName.empty())
|
else if(!interfacePropertyName.empty())
|
||||||
{
|
{
|
||||||
if(cmLinkImplementationLibraries const* impl =
|
if(cmLinkImplementationLibraries const* impl =
|
||||||
gtgt->GetLinkImplementationLibraries(context->Config))
|
target->GetLinkImplementationLibraries(context->Config))
|
||||||
{
|
{
|
||||||
linkedTargetsContent =
|
linkedTargetsContent =
|
||||||
getLinkedTargetsContent(impl->Libraries, gtgt,
|
getLinkedTargetsContent(impl->Libraries, target,
|
||||||
gtgt,
|
target,
|
||||||
context, &dagChecker,
|
context, &dagChecker,
|
||||||
interfacePropertyName);
|
interfacePropertyName);
|
||||||
}
|
}
|
||||||
|
@ -1148,40 +1143,40 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
{
|
{
|
||||||
return linkedTargetsContent;
|
return linkedTargetsContent;
|
||||||
}
|
}
|
||||||
if (gtgt->IsLinkInterfaceDependentBoolProperty(propertyName,
|
if (target->IsLinkInterfaceDependentBoolProperty(propertyName,
|
||||||
context->Config))
|
context->Config))
|
||||||
{
|
{
|
||||||
context->HadContextSensitiveCondition = true;
|
context->HadContextSensitiveCondition = true;
|
||||||
return gtgt->GetLinkInterfaceDependentBoolProperty(
|
return target->GetLinkInterfaceDependentBoolProperty(
|
||||||
propertyName,
|
propertyName,
|
||||||
context->Config) ? "1" : "0";
|
context->Config) ? "1" : "0";
|
||||||
}
|
}
|
||||||
if (gtgt->IsLinkInterfaceDependentStringProperty(propertyName,
|
if (target->IsLinkInterfaceDependentStringProperty(propertyName,
|
||||||
context->Config))
|
context->Config))
|
||||||
{
|
{
|
||||||
context->HadContextSensitiveCondition = true;
|
context->HadContextSensitiveCondition = true;
|
||||||
const char *propContent =
|
const char *propContent =
|
||||||
gtgt->GetLinkInterfaceDependentStringProperty(
|
target->GetLinkInterfaceDependentStringProperty(
|
||||||
propertyName,
|
propertyName,
|
||||||
context->Config);
|
context->Config);
|
||||||
return propContent ? propContent : "";
|
return propContent ? propContent : "";
|
||||||
}
|
}
|
||||||
if (gtgt->IsLinkInterfaceDependentNumberMinProperty(propertyName,
|
if (target->IsLinkInterfaceDependentNumberMinProperty(propertyName,
|
||||||
context->Config))
|
context->Config))
|
||||||
{
|
{
|
||||||
context->HadContextSensitiveCondition = true;
|
context->HadContextSensitiveCondition = true;
|
||||||
const char *propContent =
|
const char *propContent =
|
||||||
gtgt->GetLinkInterfaceDependentNumberMinProperty(
|
target->GetLinkInterfaceDependentNumberMinProperty(
|
||||||
propertyName,
|
propertyName,
|
||||||
context->Config);
|
context->Config);
|
||||||
return propContent ? propContent : "";
|
return propContent ? propContent : "";
|
||||||
}
|
}
|
||||||
if (gtgt->IsLinkInterfaceDependentNumberMaxProperty(propertyName,
|
if (target->IsLinkInterfaceDependentNumberMaxProperty(propertyName,
|
||||||
context->Config))
|
context->Config))
|
||||||
{
|
{
|
||||||
context->HadContextSensitiveCondition = true;
|
context->HadContextSensitiveCondition = true;
|
||||||
const char *propContent =
|
const char *propContent =
|
||||||
gtgt->GetLinkInterfaceDependentNumberMaxProperty(
|
target->GetLinkInterfaceDependentNumberMaxProperty(
|
||||||
propertyName,
|
propertyName,
|
||||||
context->Config);
|
context->Config);
|
||||||
return propContent ? propContent : "";
|
return propContent ? propContent : "";
|
||||||
|
@ -1193,22 +1188,22 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
if (!target->IsImported()
|
if (!target->IsImported()
|
||||||
&& dagCheckerParent && !dagCheckerParent->EvaluatingLinkLibraries())
|
&& dagCheckerParent && !dagCheckerParent->EvaluatingLinkLibraries())
|
||||||
{
|
{
|
||||||
if (gtgt->IsLinkInterfaceDependentNumberMinProperty(propertyName,
|
if (target->IsLinkInterfaceDependentNumberMinProperty(propertyName,
|
||||||
context->Config))
|
context->Config))
|
||||||
{
|
{
|
||||||
context->HadContextSensitiveCondition = true;
|
context->HadContextSensitiveCondition = true;
|
||||||
const char *propContent =
|
const char *propContent =
|
||||||
gtgt->GetLinkInterfaceDependentNumberMinProperty(
|
target->GetLinkInterfaceDependentNumberMinProperty(
|
||||||
propertyName,
|
propertyName,
|
||||||
context->Config);
|
context->Config);
|
||||||
return propContent ? propContent : "";
|
return propContent ? propContent : "";
|
||||||
}
|
}
|
||||||
if (gtgt->IsLinkInterfaceDependentNumberMaxProperty(propertyName,
|
if (target->IsLinkInterfaceDependentNumberMaxProperty(propertyName,
|
||||||
context->Config))
|
context->Config))
|
||||||
{
|
{
|
||||||
context->HadContextSensitiveCondition = true;
|
context->HadContextSensitiveCondition = true;
|
||||||
const char *propContent =
|
const char *propContent =
|
||||||
gtgt->GetLinkInterfaceDependentNumberMaxProperty(
|
target->GetLinkInterfaceDependentNumberMaxProperty(
|
||||||
propertyName,
|
propertyName,
|
||||||
context->Config);
|
context->Config);
|
||||||
return propContent ? propContent : "";
|
return propContent ? propContent : "";
|
||||||
|
@ -1216,11 +1211,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
}
|
}
|
||||||
if(!interfacePropertyName.empty())
|
if(!interfacePropertyName.empty())
|
||||||
{
|
{
|
||||||
cmGeneratorTarget* gHeadTarget =
|
|
||||||
context->LG->GetGlobalGenerator()->GetGeneratorTarget(headTarget);
|
|
||||||
std::string result = this->EvaluateDependentExpression(prop,
|
std::string result = this->EvaluateDependentExpression(prop,
|
||||||
context->LG, context,
|
context->LG, context,
|
||||||
gHeadTarget, gtgt, &dagChecker);
|
headTarget, target, &dagChecker);
|
||||||
if (!linkedTargetsContent.empty())
|
if (!linkedTargetsContent.empty())
|
||||||
{
|
{
|
||||||
result += (result.empty() ? "" : ";") + linkedTargetsContent;
|
result += (result.empty() ? "" : ";") + linkedTargetsContent;
|
||||||
|
@ -1341,7 +1334,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
|
||||||
const GeneratorExpressionContent *content,
|
const GeneratorExpressionContent *content,
|
||||||
cmGeneratorExpressionDAGChecker *dagChecker) const
|
cmGeneratorExpressionDAGChecker *dagChecker) const
|
||||||
{
|
{
|
||||||
cmTarget const* target = context->HeadTarget;
|
cmGeneratorTarget const* target = context->HeadTarget;
|
||||||
if (!target)
|
if (!target)
|
||||||
{
|
{
|
||||||
reportError(context, content->GetOriginalExpression(),
|
reportError(context, content->GetOriginalExpression(),
|
||||||
|
@ -1361,7 +1354,8 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
|
||||||
{
|
{
|
||||||
std::string error;
|
std::string error;
|
||||||
std::string lang;
|
std::string lang;
|
||||||
if (!context->LG->GetMakefile()->CompileFeatureKnown(context->HeadTarget,
|
if (!context->LG->GetMakefile()->CompileFeatureKnown(
|
||||||
|
context->HeadTarget->Target,
|
||||||
*it, lang, &error))
|
*it, lang, &error))
|
||||||
{
|
{
|
||||||
reportError(context, content->GetOriginalExpression(), error);
|
reportError(context, content->GetOriginalExpression(), error);
|
||||||
|
@ -1407,7 +1401,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
|
||||||
// All features known for the language are always available.
|
// All features known for the language are always available.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!context->LG->GetMakefile()->HaveStandardAvailable(target,
|
if (!context->LG->GetMakefile()->HaveStandardAvailable(target->Target,
|
||||||
lit->first, *it))
|
lit->first, *it))
|
||||||
{
|
{
|
||||||
if (evalLL)
|
if (evalLL)
|
||||||
|
@ -1442,13 +1436,13 @@ static const char* targetPolicyWhitelist[] = {
|
||||||
#undef TARGET_POLICY_STRING
|
#undef TARGET_POLICY_STRING
|
||||||
};
|
};
|
||||||
|
|
||||||
cmPolicies::PolicyStatus statusForTarget(cmTarget const* tgt,
|
cmPolicies::PolicyStatus statusForTarget(cmGeneratorTarget const* tgt,
|
||||||
const char *policy)
|
const char *policy)
|
||||||
{
|
{
|
||||||
#define RETURN_POLICY(POLICY) \
|
#define RETURN_POLICY(POLICY) \
|
||||||
if (strcmp(policy, #POLICY) == 0) \
|
if (strcmp(policy, #POLICY) == 0) \
|
||||||
{ \
|
{ \
|
||||||
return tgt->GetPolicyStatus ## POLICY (); \
|
return tgt->Target->GetPolicyStatus ## POLICY (); \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
CM_FOR_EACH_TARGET_POLICY(RETURN_POLICY)
|
CM_FOR_EACH_TARGET_POLICY(RETURN_POLICY)
|
||||||
|
@ -1503,7 +1497,7 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
|
||||||
const char *policy = targetPolicyWhitelist[i];
|
const char *policy = targetPolicyWhitelist[i];
|
||||||
if (parameters.front() == policy)
|
if (parameters.front() == policy)
|
||||||
{
|
{
|
||||||
cmMakefile *mf = context->HeadTarget->GetMakefile();
|
cmMakefile *mf = context->HeadTarget->Target->GetMakefile();
|
||||||
switch(statusForTarget(context->HeadTarget, policy))
|
switch(statusForTarget(context->HeadTarget, policy))
|
||||||
{
|
{
|
||||||
case cmPolicies::WARN:
|
case cmPolicies::WARN:
|
||||||
|
@ -1762,8 +1756,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
|
||||||
"be used while evaluating link libraries");
|
"be used while evaluating link libraries");
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
context->DependTargets.insert(target->Target);
|
context->DependTargets.insert(target);
|
||||||
context->AllTargets.insert(target->Target);
|
context->AllTargets.insert(target);
|
||||||
|
|
||||||
std::string result =
|
std::string result =
|
||||||
TargetFilesystemArtifactResultCreator<ArtifactT>::Create(
|
TargetFilesystemArtifactResultCreator<ArtifactT>::Create(
|
||||||
|
|
|
@ -2173,9 +2173,9 @@ cmTargetTraceDependencies
|
||||||
si != sources.end(); ++si)
|
si != sources.end(); ++si)
|
||||||
{
|
{
|
||||||
cmSourceFile* sf = *si;
|
cmSourceFile* sf = *si;
|
||||||
const std::set<cmTarget const*> tgts =
|
const std::set<cmGeneratorTarget const*> tgts =
|
||||||
this->GlobalGenerator->GetFilenameTargetDepends(sf);
|
this->GlobalGenerator->GetFilenameTargetDepends(sf);
|
||||||
if (tgts.find(this->Target) != tgts.end())
|
if (tgts.find(this->GeneratorTarget) != tgts.end())
|
||||||
{
|
{
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
e << "Evaluation output file\n \"" << sf->GetFullPath()
|
e << "Evaluation output file\n \"" << sf->GetFullPath()
|
||||||
|
@ -2353,7 +2353,7 @@ cmTargetTraceDependencies
|
||||||
cmGeneratorExpression ge(cc.GetBacktrace());
|
cmGeneratorExpression ge(cc.GetBacktrace());
|
||||||
|
|
||||||
// Add target-level dependencies referenced by generator expressions.
|
// Add target-level dependencies referenced by generator expressions.
|
||||||
std::set<cmTarget*> targets;
|
std::set<cmGeneratorTarget*> targets;
|
||||||
|
|
||||||
for(cmCustomCommandLines::const_iterator cit = cc.GetCommandLines().begin();
|
for(cmCustomCommandLines::const_iterator cit = cc.GetCommandLines().begin();
|
||||||
cit != cc.GetCommandLines().end(); ++cit)
|
cit != cc.GetCommandLines().end(); ++cit)
|
||||||
|
@ -2379,12 +2379,12 @@ cmTargetTraceDependencies
|
||||||
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge
|
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge
|
||||||
= ge.Parse(*cli);
|
= ge.Parse(*cli);
|
||||||
cge->Evaluate(this->GeneratorTarget->GetLocalGenerator(), "", true);
|
cge->Evaluate(this->GeneratorTarget->GetLocalGenerator(), "", true);
|
||||||
std::set<cmTarget*> geTargets = cge->GetTargets();
|
std::set<cmGeneratorTarget*> geTargets = cge->GetTargets();
|
||||||
targets.insert(geTargets.begin(), geTargets.end());
|
targets.insert(geTargets.begin(), geTargets.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(std::set<cmTarget*>::iterator ti = targets.begin();
|
for(std::set<cmGeneratorTarget*>::iterator ti = targets.begin();
|
||||||
ti != targets.end(); ++ti)
|
ti != targets.end(); ++ti)
|
||||||
{
|
{
|
||||||
this->Target->AddUtility((*ti)->GetName());
|
this->Target->AddUtility((*ti)->GetName());
|
||||||
|
@ -5412,7 +5412,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
|
||||||
this->LinkImplicitNullProperties.insert(*it);
|
this->LinkImplicitNullProperties.insert(*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cge->GetMaxLanguageStandard(this->Target,
|
cge->GetMaxLanguageStandard(this,
|
||||||
this->MaxLanguageStandards);
|
this->MaxLanguageStandards);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3029,13 +3029,13 @@ std::string cmGlobalGenerator::EscapeJSON(const std::string& s) {
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalGenerator::SetFilenameTargetDepends(cmSourceFile* sf,
|
void cmGlobalGenerator::SetFilenameTargetDepends(cmSourceFile* sf,
|
||||||
std::set<cmTarget const*> tgts)
|
std::set<cmGeneratorTarget const*> tgts)
|
||||||
{
|
{
|
||||||
this->FilenameTargetDepends[sf] = tgts;
|
this->FilenameTargetDepends[sf] = tgts;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::set<cmTarget const*> const&
|
std::set<cmGeneratorTarget const*> const&
|
||||||
cmGlobalGenerator::GetFilenameTargetDepends(cmSourceFile* sf) const {
|
cmGlobalGenerator::GetFilenameTargetDepends(cmSourceFile* sf) const {
|
||||||
return this->FilenameTargetDepends[sf];
|
return this->FilenameTargetDepends[sf];
|
||||||
}
|
}
|
||||||
|
|
|
@ -354,8 +354,8 @@ public:
|
||||||
void CreateEvaluationSourceFiles(std::string const& config) const;
|
void CreateEvaluationSourceFiles(std::string const& config) const;
|
||||||
|
|
||||||
void SetFilenameTargetDepends(cmSourceFile* sf,
|
void SetFilenameTargetDepends(cmSourceFile* sf,
|
||||||
std::set<cmTarget const*> tgts);
|
std::set<const cmGeneratorTarget*> tgts);
|
||||||
std::set<cmTarget const*> const&
|
const std::set<const cmGeneratorTarget*>&
|
||||||
GetFilenameTargetDepends(cmSourceFile* sf) const;
|
GetFilenameTargetDepends(cmSourceFile* sf) const;
|
||||||
|
|
||||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
|
@ -508,7 +508,7 @@ private:
|
||||||
// track targets to issue CMP0042 warning for.
|
// track targets to issue CMP0042 warning for.
|
||||||
std::set<std::string> CMP0042WarnTargets;
|
std::set<std::string> CMP0042WarnTargets;
|
||||||
|
|
||||||
mutable std::map<cmSourceFile*, std::set<cmTarget const*> >
|
mutable std::map<cmSourceFile*, std::set<cmGeneratorTarget const*> >
|
||||||
FilenameTargetDepends;
|
FilenameTargetDepends;
|
||||||
|
|
||||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
|
|
Loading…
Reference in New Issue