Commit b1c19ce3 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

Genex: Make LINK_LANGUAGE report an error when evaluating link libraries.

parent 0e1cb07e
......@@ -415,8 +415,15 @@ static const struct LinkLanguageNode : public cmGeneratorExpressionNode
std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *context,
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *) const
cmGeneratorExpressionDAGChecker *dagChecker) const
if (dagChecker && dagChecker->EvaluatingLinkLibraries())
reportError(context, content->GetOriginalExpression(),
"$<LINK_LANGUAGE> expression can not be used while evaluating "
"link libraries");
return std::string();
if (parameters.size() != 0 && parameters.size() != 1)
reportError(context, content->GetOriginalExpression(),
CMake Error:
Error evaluating generator expression:
\$<LINK_LANGUAGE> expression can not be used while evaluating link libraries
add_library(foo SHARED empty.cpp)
add_library(bar SHARED empty.cpp)
target_link_libraries(foo $<$<STREQUAL:$<LINK_LANGUAGE>,anything>:bar>)
#ifdef _WIN32
int empty(void)
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment