[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2841-gd7a7bb3
Stephen Kelly
steveire at gmail.com
Tue Apr 30 04:27:12 EDT 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 d7a7bb33aea7783b716528f13604d80d0a0c7a8b (commit)
via 59ef6f3b59c60db8d7d37e000416e40739218420 (commit)
via eff931bba37b6fe1439f43de6bb49b2fd7a7cf92 (commit)
from e33ab852ac02636376ed2abce02a4599db7792be (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=d7a7bb33aea7783b716528f13604d80d0a0c7a8b
commit d7a7bb33aea7783b716528f13604d80d0a0c7a8b
Merge: e33ab85 59ef6f3
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Apr 30 04:27:08 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 30 04:27:08 2013 -0400
Merge topic 'fix-per-config-tll-include-dirs' into next
59ef6f3 Ensure that empty strings are not passed to the genex TARGET_PROPERTY
eff931b Only handle interface includes for valid target names.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59ef6f3b59c60db8d7d37e000416e40739218420
commit 59ef6f3b59c60db8d7d37e000416e40739218420
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Apr 29 12:00:53 2013 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Apr 30 10:11:11 2013 +0200
Ensure that empty strings are not passed to the genex TARGET_PROPERTY
Ensure that a link entry is a non-empty string before processing
includes from it.
Include directories are processed from the link interface of
dependent targets since commit a1c4905f (Use the link information
as a source of compile definitions and includes., 2013-02-12). That
commit included an optimization of skipping an entry from the link
interface if it is known not to be a target after evaluation as a
generator expression.
Commit 42ebb188 (Memoize includes and defines from interface
libraries., 2013-02-22) introduced caching of the includes. Part of
the problem is that the cache for the includes is not config
sensitive because the content can contain $<CONFIG> generator
expressions which will be evaluated anyway.
When generating the buildsystem with a multi-config generator,
the GetIncludeDirectories method happens to be called first with
the DEBUG configuration, followed by the others. So, in the
testcase:
add_library(B SHARED a.c)
target_link_libraries(B debug A)
the $<$<CONFIG:Debug>:A> is evaluated to 'A', and the generator
expression is cached. When the same genex is evaluated with
non-debug configurations, the evaluated result is the empty string,
which does not validate for the the TARGET_PROPERTY generator
expression.
If the 'debug' is replaced by 'optimized' in the testcase, the
bug does not occur. That is because the first call to
GetIncludeDirectories will evaluate $<NOT:$<CONFIG:Debug>:A>, get
an empty string (because config == Debug), and continue before
caching the result. The next call to GetIncludeDirectories will
be a non-empty string.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 286e552..6c639f1 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2944,10 +2944,18 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
continue;
}
}
+ std::string includeGenex = "$<TARGET_PROPERTY:" +
+ it->Value + ",INTERFACE_INCLUDE_DIRECTORIES>";
+ if (cmGeneratorExpression::Find(it->Value) != std::string::npos)
+ {
+ // Because it->Value is a generator expression, ensure that it
+ // evaluates to the non-empty string before being used in the
+ // TARGET_PROPERTY expression.
+ includeGenex = "$<$<BOOL:" + it->Value + ">:" + includeGenex + ">";
+ }
cmGeneratorExpression ge(it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
- "$<$<BOOL:"+it->Value+">:"
- "$<TARGET_PROPERTY:"+it->Value+",INTERFACE_INCLUDE_DIRECTORIES>>");
+ includeGenex);
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries.push_back(
new cmTargetInternals::IncludeDirectoriesEntry(cge,
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eff931bba37b6fe1439f43de6bb49b2fd7a7cf92
commit eff931bba37b6fe1439f43de6bb49b2fd7a7cf92
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Apr 29 11:54:19 2013 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Apr 30 10:10:27 2013 +0200
Only handle interface includes for valid target names.
As of CMake 2.8.11, generator expressions, including
configuration-specific expressions may be used as link libraries
of targets. The old-style keywords of target_link_libraries are
handled in terms of new generator expressions.
However, the generator expressions expect target names to be valid
against a regular expression, whereas target_link_libraries does
not require validation.
As this genex code is generated without any action from the user in
the next release, we need to ensure that only valid code is generated.
Ensure that strings which are not valid target names are not used
in generator expressions which validate the argument.
Commit 254687d3 (Only process transitive interface properties
for valid target names., 2013-03-06) introduced an ommission of a
link entry if it does validates as a target name when processing
interface include directories from dependent targets. That check is
now obsolete.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3d0d019..286e552 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2939,8 +2939,7 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
ge.Parse(it->Value);
std::string result = cge->Evaluate(this->Makefile, config,
false, this, 0, 0);
- if (!cmGeneratorExpression::IsValidTargetName(result.c_str())
- || !this->Makefile->FindTargetToUse(result.c_str()))
+ if (!this->Makefile->FindTargetToUse(result.c_str()))
{
continue;
}
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 3f652c9..60a4011 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -259,14 +259,16 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
// Handle normal case first.
if(this->CurrentProcessingState != ProcessingLinkInterface)
{
- {
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmValueWithOrigin entry(this->Target->GetDebugGeneratorExpressions(lib,
- llt),
- lfbt);
- this->Target->AppendTllInclude(entry);
- }
+ if (cmGeneratorExpression::IsValidTargetName(lib)
+ || cmGeneratorExpression::Find(lib) != std::string::npos)
+ {
+ cmListFileBacktrace lfbt;
+ this->Makefile->GetBacktrace(lfbt);
+ cmValueWithOrigin entry(this->Target->GetDebugGeneratorExpressions(lib,
+ llt),
+ lfbt);
+ this->Target->AppendTllInclude(entry);
+ }
this->Makefile
->AddLinkLibraryForTarget(this->Target->GetName(), lib, llt);
if (this->CurrentProcessingState != ProcessingPublicInterface)
-----------------------------------------------------------------------
Summary of changes:
Source/cmTarget.cxx | 15 +++++++++++----
Source/cmTargetLinkLibrariesCommand.cxx | 18 ++++++++++--------
2 files changed, 21 insertions(+), 12 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list