Merge topic 'tll-allow-genex'
1da7502
Don't include generator expressions in old-style link handling.
This commit is contained in:
commit
8d91e23565
|
@ -2245,6 +2245,14 @@ static std::string targetNameGenex(const char *lib)
|
|||
return std::string("$<TARGET_NAME:") + 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,
|
||||
|
@ -2267,6 +2275,11 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
|
|||
llt).c_str());
|
||||
}
|
||||
|
||||
if (isGeneratorExpression(lib))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
cmTarget::LibraryID tmp;
|
||||
tmp.first = lib;
|
||||
tmp.second = llt;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#define cmTargetLinkLibrariesCommand_h
|
||||
|
||||
#include "cmCommand.h"
|
||||
#include "cmDocumentGeneratorExpressions.h"
|
||||
|
||||
/** \class cmTargetLinkLibrariesCommand
|
||||
* \brief Specify a list of libraries to link into executables.
|
||||
|
@ -141,6 +142,12 @@ public:
|
|||
"However, if two archives are really so interdependent they should "
|
||||
"probably be combined into a single archive."
|
||||
")"
|
||||
"\n"
|
||||
"Arguments to target_link_libraries may use \"generator expressions\" "
|
||||
"with the syntax \"$<...>\". Note however, that generator expressions "
|
||||
"will not be used in OLD handling of CMP0003 or CMP0004."
|
||||
"\n"
|
||||
CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
|
||||
;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue