[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1875-gae36e0b
Stephen Kelly
steveire at gmail.com
Sun Feb 3 01:47:18 EST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via ae36e0b253e7ef03a61f6b4b4fc20eed80000ddc (commit)
via 4b5dd3a966e2c5580a838be90dc75993cfba4754 (commit)
from 910773f4b0f112945c7b6d1b0322d18c80001ef5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ae36e0b253e7ef03a61f6b4b4fc20eed80000ddc
commit ae36e0b253e7ef03a61f6b4b4fc20eed80000ddc
Merge: 910773f 4b5dd3a
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Feb 3 01:47:15 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Feb 3 01:47:15 2013 -0500
Merge topic 'tll-includes-defines' into next
4b5dd3a Cache context-independent includes on evaluation.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4b5dd3a966e2c5580a838be90dc75993cfba4754
commit 4b5dd3a966e2c5580a838be90dc75993cfba4754
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Feb 3 07:33:15 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Feb 3 07:37:47 2013 +0100
Cache context-independent includes on evaluation.
Generator expressions whose output depends on the configuration
now record that fact. The GetIncludeDirectories method can use
that result to cache the include directories for later calls.
GetIncludeDirectories is called multiple times for a target
for each configuration, so this should restore performance for
multi-config generators.
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 78ae8f2..86f331f 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -88,6 +88,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
context.Config = config;
context.Quiet = quiet;
context.HadError = false;
+ context.HadContextSensitiveCondition = false;
context.HeadTarget = headTarget;
context.CurrentTarget = currentTarget ? currentTarget : headTarget;
context.Backtrace = this->Backtrace;
@@ -109,6 +110,10 @@ const char *cmCompiledGeneratorExpression::Evaluate(
break;
}
}
+ if (!context.HadError)
+ {
+ this->HadContextSensitiveCondition = context.HadContextSensitiveCondition;
+ }
this->Targets = context.Targets;
// TODO: Return a std::string from here instead?
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 8f1aef6..700fe03 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -100,6 +100,10 @@ public:
{
return this->Backtrace;
}
+ bool GetHadContextSensitiveCondition() const
+ {
+ return this->HadContextSensitiveCondition;
+ }
private:
cmCompiledGeneratorExpression(cmListFileBacktrace const& backtrace,
@@ -118,6 +122,7 @@ private:
mutable std::set<cmTarget*> Targets;
mutable std::map<cmStdString, cmStdString> SeenTargetProperties;
mutable std::string Output;
+ mutable bool HadContextSensitiveCondition;
};
#endif
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index cd4b7d8..5d94718 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -238,6 +238,7 @@ static const struct ConfigurationNode : public cmGeneratorExpressionNode
const GeneratorExpressionContent *,
cmGeneratorExpressionDAGChecker *) const
{
+ context->HadContextSensitiveCondition = true;
return context->Config ? context->Config : "";
}
} configurationNode;
@@ -262,6 +263,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
"Expression syntax not recognized.");
return std::string();
}
+ context->HadContextSensitiveCondition = true;
if (!context->Config)
{
return parameters.front().empty() ? "1" : "0";
@@ -455,12 +457,14 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
if (propertyName == "POSITION_INDEPENDENT_CODE")
{
+ context->HadContextSensitiveCondition = true;
return target->GetLinkInterfaceDependentBoolProperty(
"POSITION_INDEPENDENT_CODE", context->Config) ? "1" : "0";
}
if (target->IsLinkInterfaceDependentBoolProperty(propertyName,
context->Config))
{
+ context->HadContextSensitiveCondition = true;
return target->GetLinkInterfaceDependentBoolProperty(
propertyName,
context->Config) ? "1" : "0";
@@ -468,6 +472,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if (target->IsLinkInterfaceDependentStringProperty(propertyName,
context->Config))
{
+ context->HadContextSensitiveCondition = true;
const char *propContent =
target->GetLinkInterfaceDependentStringProperty(
propertyName,
@@ -486,12 +491,19 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if (targetPropertyTransitiveWhitelist[i] == propertyName)
{
cmGeneratorExpression ge(context->Backtrace);
- return ge.Parse(prop)->Evaluate(context->Makefile,
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
+ std::string result = cge->Evaluate(context->Makefile,
context->Config,
context->Quiet,
context->HeadTarget,
target,
&dagChecker);
+
+ if (cge->GetHadContextSensitiveCondition())
+ {
+ context->HadContextSensitiveCondition = true;
+ }
+ return result;
}
}
return prop;
@@ -585,6 +597,9 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
"be used with add_custom_command.");
return std::string();
}
+
+ context->HadContextSensitiveCondition = true;
+
for (size_t i = 0;
i < (sizeof(targetPolicyWhitelist) /
sizeof(*targetPolicyWhitelist));
@@ -716,12 +731,18 @@ private:
}
cmGeneratorExpression ge(context->Backtrace);
- return ge.Parse(propContent)->Evaluate(context->Makefile,
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(propContent);
+ std::string result = cge->Evaluate(context->Makefile,
context->Config,
context->Quiet,
context->HeadTarget,
target,
&dagChecker);
+ if (cge->GetHadContextSensitiveCondition())
+ {
+ context->HadContextSensitiveCondition = true;
+ }
+ return result;
}
} linkedNode;
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index fb6c7ee..37d5c86 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -32,6 +32,7 @@ struct cmGeneratorExpressionContext
// directly or indirectly in the property.
bool Quiet;
bool HadError;
+ bool HadContextSensitiveCondition;
};
struct cmGeneratorExpressionDAGChecker;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 5669872..b52e483 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -134,6 +134,7 @@ public:
: ge(cge)
{}
const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
+ std::vector<std::string> CachedIncludes;
};
std::vector<IncludeDirectoriesEntry*> IncludeDirectoriesEntries;
};
@@ -2778,13 +2779,20 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
end = this->Internal->IncludeDirectoriesEntries.end();
it != end; ++it)
{
- std::vector<std::string> entryIncludes;
- cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(this->Makefile,
- config,
- false,
- this,
- &dagChecker),
- entryIncludes);
+ std::vector<std::string> entryIncludes = (*it)->CachedIncludes;
+ if(entryIncludes.empty())
+ {
+ cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(this->Makefile,
+ config,
+ false,
+ this,
+ &dagChecker),
+ entryIncludes);
+ if (!(*it)->ge->GetHadContextSensitiveCondition())
+ {
+ (*it)->CachedIncludes = entryIncludes;
+ }
+ }
std::string usedIncludes;
for(std::vector<std::string>::const_iterator
li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
-----------------------------------------------------------------------
Summary of changes:
Source/cmGeneratorExpression.cxx | 5 +++++
Source/cmGeneratorExpression.h | 5 +++++
Source/cmGeneratorExpressionEvaluator.cxx | 25 +++++++++++++++++++++++--
Source/cmGeneratorExpressionEvaluator.h | 1 +
Source/cmTarget.cxx | 22 +++++++++++++++-------
5 files changed, 49 insertions(+), 9 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list