diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-12-23 18:00:18 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-01-13 08:59:42 (GMT) |
commit | 1da75022bbe3239e028fe73d94dfae724ad25a7f (patch) | |
tree | 2436a13c2ba566f1895946d2dc50a3fdbf47aa19 /Source/cmTarget.cxx | |
parent | 9822f8c931c39b28a587cf48b5314431386d50ea (diff) | |
download | CMake-1da75022bbe3239e028fe73d94dfae724ad25a7f.zip CMake-1da75022bbe3239e028fe73d94dfae724ad25a7f.tar.gz CMake-1da75022bbe3239e028fe73d94dfae724ad25a7f.tar.bz2 |
Don't include generator expressions in old-style link handling.
Don't add generator expressions to variables which are used
for CMP0003, CMP0004, and the old-style _LIB_DEPENDS content. They
will not be evaluated when read anyway and would probably confuse
the code reading them.
This makes it legitimate to use target_link_libraries with generator
expressions as arguments.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9b50b8e..51512de 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2233,6 +2233,14 @@ static std::string targetNameGenex(const char *lib) } //---------------------------------------------------------------------------- +static bool isGeneratorExpression(const std::string &lib) +{ + const std::string::size_type openpos = lib.find("$<"); + return (openpos != std::string::npos) + && (lib.find(">", openpos) != std::string::npos); +} + +//---------------------------------------------------------------------------- void cmTarget::AddLinkLibrary(cmMakefile& mf, const char *target, const char* lib, LinkLibraryType llt) @@ -2254,6 +2262,11 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, llt).c_str()); } + if (isGeneratorExpression(lib)) + { + return; + } + cmTarget::LibraryID tmp; tmp.first = lib; tmp.second = llt; |