Revert "Add the TARGET_DEFINED generator expression"
This reverts commit 2bee6f5ba5
.
This expression is not used, and has a semantic which is not completely
optimal (namely considering utility targets to be targets, though
usually we are interested in linkable targets).
Remove it so that we have more freedom to define better expressions in
the future.
Conflicts:
Source/cmGeneratorExpressionEvaluator.cxx
Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
Tests/CMakeCommands/target_compile_definitions/consumer.cpp
This commit is contained in:
parent
21a342c8b1
commit
cbf07569ed
|
@ -37,7 +37,6 @@
|
||||||
"target in the same buildsystem. Expands to the empty string " \
|
"target in the same buildsystem. Expands to the empty string " \
|
||||||
"otherwise.\n" \
|
"otherwise.\n" \
|
||||||
" $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
|
" $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
|
||||||
" $<TARGET_DEFINED:tgt> = '1' if tgt is a target, else '0'\n" \
|
|
||||||
" $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
|
" $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
|
||||||
" $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n" \
|
" $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n" \
|
||||||
"where \"tgt\" is the name of a target. " \
|
"where \"tgt\" is the name of a target. " \
|
||||||
|
|
|
@ -291,22 +291,6 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
|
||||||
} configurationTestNode;
|
} configurationTestNode;
|
||||||
|
|
||||||
|
|
||||||
static const struct TargetDefinedNode : public cmGeneratorExpressionNode
|
|
||||||
{
|
|
||||||
TargetDefinedNode() {}
|
|
||||||
|
|
||||||
virtual int NumExpectedParameters() const { return 1; }
|
|
||||||
|
|
||||||
std::string Evaluate(const std::vector<std::string> ¶meters,
|
|
||||||
cmGeneratorExpressionContext *context,
|
|
||||||
const GeneratorExpressionContent *,
|
|
||||||
cmGeneratorExpressionDAGChecker *) const
|
|
||||||
{
|
|
||||||
return context->Makefile->FindTargetToUse(parameters.front().c_str())
|
|
||||||
? "1" : "0";
|
|
||||||
}
|
|
||||||
} targetDefinedNode;
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static const char* targetPropertyTransitiveWhitelist[] = {
|
static const char* targetPropertyTransitiveWhitelist[] = {
|
||||||
"INTERFACE_INCLUDE_DIRECTORIES"
|
"INTERFACE_INCLUDE_DIRECTORIES"
|
||||||
|
@ -942,8 +926,6 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
|
||||||
return &buildInterfaceNode;
|
return &buildInterfaceNode;
|
||||||
else if (identifier == "INSTALL_INTERFACE")
|
else if (identifier == "INSTALL_INTERFACE")
|
||||||
return &installInterfaceNode;
|
return &installInterfaceNode;
|
||||||
else if (identifier == "TARGET_DEFINED")
|
|
||||||
return &targetDefinedNode;
|
|
||||||
else if (identifier == "INSTALL_PREFIX")
|
else if (identifier == "INSTALL_PREFIX")
|
||||||
return &installPrefixNode;
|
return &installPrefixNode;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -18,7 +18,5 @@ add_executable(consumer
|
||||||
|
|
||||||
target_compile_definitions(consumer
|
target_compile_definitions(consumer
|
||||||
PRIVATE $<TARGET_PROPERTY:target_compile_definitions,INTERFACE_COMPILE_DEFINITIONS>
|
PRIVATE $<TARGET_PROPERTY:target_compile_definitions,INTERFACE_COMPILE_DEFINITIONS>
|
||||||
$<$<TARGET_DEFINED:notdefined>:SHOULD_NOT_BE_DEFINED>
|
|
||||||
$<$<TARGET_DEFINED:target_compile_definitions>:SHOULD_BE_DEFINED>
|
|
||||||
-DDASH_D_DEFINE
|
-DDASH_D_DEFINE
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,14 +11,6 @@
|
||||||
#error Expected MY_INTERFACE_DEFINE
|
#error Expected MY_INTERFACE_DEFINE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SHOULD_NOT_BE_DEFINED
|
|
||||||
#error Unexpected SHOULD_NOT_BE_DEFINED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SHOULD_BE_DEFINED
|
|
||||||
#error Expected SHOULD_BE_DEFINED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DASH_D_DEFINE
|
#ifndef DASH_D_DEFINE
|
||||||
#error Expected DASH_D_DEFINE
|
#error Expected DASH_D_DEFINE
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue