[Cmake-commits] CMake branch, next, updated. v3.1.0-rc2-901-ga803eac
Stephen Kelly
steveire at gmail.com
Wed Nov 26 16:17:31 EST 2014
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 a803eac6cee0e79c96495780b5b0b57515a2af93 (commit)
via 672f1001c015bf5f531d8731dba30a5fb856edea (commit)
from e672b002ae71c8225559731b2afd37a166c9d1d8 (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=a803eac6cee0e79c96495780b5b0b57515a2af93
commit a803eac6cee0e79c96495780b5b0b57515a2af93
Merge: e672b00 672f100
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Nov 26 16:17:30 2014 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Nov 26 16:17:30 2014 -0500
Merge topic 'fix-transitive-OBJECT_SOURCES-context' into next
672f1001 Genex: Fix evaluation context propagation for TARGET_OBJECTS.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=672f1001c015bf5f531d8731dba30a5fb856edea
commit 672f1001c015bf5f531d8731dba30a5fb856edea
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Nov 26 21:29:05 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Nov 26 22:16:15 2014 +0100
Genex: Fix evaluation context propagation for TARGET_OBJECTS.
Extract a new method to encapsulate the requirements of evaluating
dependent-expressions, namely, propagation of the
EvaluateForBuildsystem setting, which is missing from the
getLinkedTargetsContent implementation.
Commit v3.1.0-rc1~688^2 (Genex: Only evaluate TARGET_OBJECTS to determine
target sources., 2014-03-20) introduced an error case for use of
TARGET_OBJECTS outside of the context of generating the buildsystem,
as the path to object files may be dependent on buildsystem
variables (See bug #15226).
Commit v3.1.0-rc1~314^2 (Allow INTERFACE_SOURCES to specify
$<TARGET_OBJECTS> (#14970), 2014-07-09) made it possible to
propagate such content to dependent targets.
While that commit propagated the EvaluateForBuildsystem setting
for the case of a TARGET_PROPERTY expression, as generated for
direct dependencies of a target in
cmTargetInternals::AddInterfaceEntries, it did not add propagation
for content from further transitive target dependencies, as determined
by getLinkedTargetsContent.
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 67a1a6d..84a4daa 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -69,9 +69,42 @@ struct cmGeneratorExpressionNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *dagChecker
) const = 0;
+
+ static std::string EvaluateDependentExpression(
+ std::string const& prop, cmMakefile *makefile,
+ cmGeneratorExpressionContext *context,
+ cmTarget const* headTarget, cmTarget const* currentTarget,
+ cmGeneratorExpressionDAGChecker *dagChecker);
};
//----------------------------------------------------------------------------
+std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
+ std::string const& prop, cmMakefile *makefile,
+ cmGeneratorExpressionContext *context,
+ cmTarget const* headTarget, cmTarget const* currentTarget,
+ cmGeneratorExpressionDAGChecker *dagChecker)
+{
+ cmGeneratorExpression ge(&context->Backtrace);
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
+ cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem);
+ std::string result = cge->Evaluate(makefile,
+ context->Config,
+ context->Quiet,
+ headTarget,
+ currentTarget,
+ dagChecker);
+ if (cge->GetHadContextSensitiveCondition())
+ {
+ context->HadContextSensitiveCondition = true;
+ }
+ if (cge->GetHadHeadSensitiveCondition())
+ {
+ context->HadHeadSensitiveCondition = true;
+ }
+ return result;
+}
+
+//----------------------------------------------------------------------------
static const struct ZeroNode : public cmGeneratorExpressionNode
{
ZeroNode() {}
@@ -825,22 +858,10 @@ getLinkedTargetsContent(
}
if(!depString.empty())
{
- cmGeneratorExpression ge(&context->Backtrace);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(depString);
- linkedTargetsContent = cge->Evaluate(target->GetMakefile(),
- context->Config,
- context->Quiet,
- headTarget,
- target,
- dagChecker);
- if (cge->GetHadContextSensitiveCondition())
- {
- context->HadContextSensitiveCondition = true;
- }
- if (cge->GetHadHeadSensitiveCondition())
- {
- context->HadHeadSensitiveCondition = true;
- }
+ linkedTargetsContent =
+ cmGeneratorExpressionNode::EvaluateDependentExpression(depString,
+ target->GetMakefile(), context,
+ headTarget, target, dagChecker);
}
linkedTargetsContent =
cmGeneratorExpression::StripEmptyListElements(linkedTargetsContent);
@@ -1181,24 +1202,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
if(!interfacePropertyName.empty())
{
- cmGeneratorExpression ge(&context->Backtrace);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
- cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem);
- std::string result = cge->Evaluate(context->Makefile,
- context->Config,
- context->Quiet,
- headTarget,
- target,
- &dagChecker);
-
- if (cge->GetHadContextSensitiveCondition())
- {
- context->HadContextSensitiveCondition = true;
- }
- if (cge->GetHadHeadSensitiveCondition())
- {
- context->HadHeadSensitiveCondition = true;
- }
+ std::string result = this->EvaluateDependentExpression(prop,
+ context->Makefile, context,
+ headTarget, target, &dagChecker);
if (!linkedTargetsContent.empty())
{
result += (result.empty() ? "" : ";") + linkedTargetsContent;
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index fe202dd..ee81419 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -22,8 +22,11 @@ add_library(objlib OBJECT obj.cpp)
add_library(iface_objlib INTERFACE)
target_sources(iface_objlib INTERFACE $<TARGET_OBJECTS:objlib>)
+add_library(intermediate INTERFACE)
+target_link_libraries(intermediate INTERFACE iface_objlib)
+
add_executable(InterfaceLibrary definetestexe.cpp)
-target_link_libraries(InterfaceLibrary iface_nodepends headeriface subiface iface_objlib)
+target_link_libraries(InterfaceLibrary iface_nodepends headeriface subiface intermediate)
add_subdirectory(libsdir)
-----------------------------------------------------------------------
Summary of changes:
Source/cmGeneratorExpressionEvaluator.cxx | 74 ++++++++++++++++-------------
Tests/InterfaceLibrary/CMakeLists.txt | 5 +-
2 files changed, 44 insertions(+), 35 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list