Port cmGeneratorExpression to cmTarget from cmGeneratorTarget.
Following from the discussion here: http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3615/focus=5170 (Re: Generator expressisons in target properties, 26 Oct 12:10) we can't split cmTarget API for linking into cmGeneratorTarget. In the future we will probably also need to move the include and compile definitions API back to cmTarget so that it can be used by export().
This commit is contained in:
parent
8faf4e9380
commit
d8a59ea4b3
|
@ -68,7 +68,7 @@ cmGeneratorExpression::~cmGeneratorExpression()
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
const char *cmCompiledGeneratorExpression::Evaluate(
|
const char *cmCompiledGeneratorExpression::Evaluate(
|
||||||
cmMakefile* mf, const char* config, bool quiet,
|
cmMakefile* mf, const char* config, bool quiet,
|
||||||
cmGeneratorTarget *target,
|
cmTarget *target,
|
||||||
cmGeneratorExpressionDAGChecker *dagChecker) const
|
cmGeneratorExpressionDAGChecker *dagChecker) const
|
||||||
{
|
{
|
||||||
if (!this->NeedsParsing)
|
if (!this->NeedsParsing)
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include <cmsys/RegularExpression.hxx>
|
#include <cmsys/RegularExpression.hxx>
|
||||||
|
|
||||||
class cmTarget;
|
class cmTarget;
|
||||||
class cmGeneratorTarget;
|
|
||||||
class cmMakefile;
|
class cmMakefile;
|
||||||
class cmListFileBacktrace;
|
class cmListFileBacktrace;
|
||||||
|
|
||||||
|
@ -68,7 +67,7 @@ class cmCompiledGeneratorExpression
|
||||||
public:
|
public:
|
||||||
const char* Evaluate(cmMakefile* mf, const char* config,
|
const char* Evaluate(cmMakefile* mf, const char* config,
|
||||||
bool quiet = false,
|
bool quiet = false,
|
||||||
cmGeneratorTarget *target = 0,
|
cmTarget *target = 0,
|
||||||
cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
|
cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
|
||||||
|
|
||||||
/** Get set of targets found during evaluations. */
|
/** Get set of targets found during evaluations. */
|
||||||
|
|
|
@ -287,7 +287,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
cmsys::RegularExpression propertyNameValidator;
|
cmsys::RegularExpression propertyNameValidator;
|
||||||
propertyNameValidator.compile("^[A-Za-z0-9_]+$");
|
propertyNameValidator.compile("^[A-Za-z0-9_]+$");
|
||||||
|
|
||||||
cmGeneratorTarget* target = context->Target;
|
cmTarget* target = context->Target;
|
||||||
std::string propertyName = *parameters.begin();
|
std::string propertyName = *parameters.begin();
|
||||||
if (parameters.size() == 2)
|
if (parameters.size() == 2)
|
||||||
{
|
{
|
||||||
|
@ -320,7 +320,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
"Target name not supported.");
|
"Target name not supported.");
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
target = context->Makefile->FindGeneratorTargetToUse(
|
target = context->Makefile->FindTargetToUse(
|
||||||
targetName.c_str());
|
targetName.c_str());
|
||||||
|
|
||||||
if (!target)
|
if (!target)
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include "cmListFileCache.h"
|
#include "cmListFileCache.h"
|
||||||
|
|
||||||
class cmTarget;
|
class cmTarget;
|
||||||
class cmGeneratorTarget;
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
struct cmGeneratorExpressionContext
|
struct cmGeneratorExpressionContext
|
||||||
|
@ -27,7 +26,7 @@ struct cmGeneratorExpressionContext
|
||||||
std::set<cmTarget*> Targets;
|
std::set<cmTarget*> Targets;
|
||||||
cmMakefile *Makefile;
|
cmMakefile *Makefile;
|
||||||
const char *Config;
|
const char *Config;
|
||||||
cmGeneratorTarget *Target;
|
cmTarget *Target;
|
||||||
bool Quiet;
|
bool Quiet;
|
||||||
bool HadError;
|
bool HadError;
|
||||||
};
|
};
|
||||||
|
|
|
@ -308,7 +308,7 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
|
||||||
.Evaluate(this->Makefile,
|
.Evaluate(this->Makefile,
|
||||||
config,
|
config,
|
||||||
false,
|
false,
|
||||||
this,
|
this->Target,
|
||||||
&dagChecker),
|
&dagChecker),
|
||||||
includes);
|
includes);
|
||||||
|
|
||||||
|
@ -356,6 +356,6 @@ std::string cmGeneratorTarget::GetCompileDefinitions(const char *config)
|
||||||
return ge.Parse(prop).Evaluate(this->Makefile,
|
return ge.Parse(prop).Evaluate(this->Makefile,
|
||||||
config,
|
config,
|
||||||
false,
|
false,
|
||||||
this,
|
this->Target,
|
||||||
&dagChecker);
|
&dagChecker);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue