Handle reading empty properties defined by the link interface.
This was segfaulting before.
This commit is contained in:
parent
da2b0245a3
commit
30268b46f8
|
@ -465,9 +465,11 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
if (target->IsLinkInterfaceDependentStringProperty(propertyName,
|
if (target->IsLinkInterfaceDependentStringProperty(propertyName,
|
||||||
context->Config))
|
context->Config))
|
||||||
{
|
{
|
||||||
return target->GetLinkInterfaceDependentStringProperty(
|
const char *propContent =
|
||||||
|
target->GetLinkInterfaceDependentStringProperty(
|
||||||
propertyName,
|
propertyName,
|
||||||
context->Config);
|
context->Config);
|
||||||
|
return propContent ? propContent : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::string();
|
return std::string();
|
||||||
|
|
|
@ -48,10 +48,22 @@ target_compile_definitions(CompatibleInterface
|
||||||
add_library(iface2 SHARED iface2.cpp)
|
add_library(iface2 SHARED iface2.cpp)
|
||||||
generate_export_header(iface2)
|
generate_export_header(iface2)
|
||||||
|
|
||||||
|
set_property(TARGET iface2 APPEND PROPERTY
|
||||||
|
COMPATIBLE_INTERFACE_STRING
|
||||||
|
Iface2_PROP
|
||||||
|
)
|
||||||
|
|
||||||
# For the LINK_LIBRARIES and related properties, we should not evaluate
|
# For the LINK_LIBRARIES and related properties, we should not evaluate
|
||||||
# properties defined only in the interface - they should be implicitly zero
|
# properties defined only in the interface - they should be implicitly zero
|
||||||
set_property(TARGET iface2
|
set_property(TARGET iface2
|
||||||
APPEND PROPERTY
|
APPEND PROPERTY
|
||||||
LINK_INTERFACE_LIBRARIES $<$<BOOL:$<TARGET_PROPERTY:BOOL_PROP4>>:nonexistant>
|
LINK_INTERFACE_LIBRARIES $<$<BOOL:$<TARGET_PROPERTY:BOOL_PROP4>>:nonexistant>
|
||||||
)
|
)
|
||||||
target_link_libraries(CompatibleInterface iface2)
|
target_link_libraries(CompatibleInterface iface2
|
||||||
|
$<$<BOOL:$<TARGET_PROPERTY:Iface2_PROP>>:nonexistant>
|
||||||
|
)
|
||||||
|
# Test that this does not segfault:
|
||||||
|
target_compile_definitions(CompatibleInterface
|
||||||
|
PRIVATE
|
||||||
|
$<$<BOOL:$<TARGET_PROPERTY:Iface2_PROP>>:SOME_DEFINE>
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue