CMake: Warn when PRIVATE_MODULE_INTERFACE is provided with no target
Warn if the PRIVATE_MODULE_INTERFACE option is provided a value, but
there is no ${target}Private target to set the interface dependencies
on.
Pick-to: 6.2
Task-number: QTBUG-95921
Change-Id: I7d4df9cb3aa9b7746d836b82019ecdd9c8f50fdc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
bb10
parent
80705298ca
commit
0dbf73e3de
|
|
@ -108,8 +108,16 @@ function(qt_internal_extend_target target)
|
|||
set(target_private "${target}")
|
||||
endif()
|
||||
if(TARGET "${target_private}")
|
||||
target_link_libraries("${target_private}"
|
||||
INTERFACE ${arg_PRIVATE_MODULE_INTERFACE})
|
||||
target_link_libraries("${target_private}"
|
||||
INTERFACE ${arg_PRIVATE_MODULE_INTERFACE})
|
||||
elseif(arg_PRIVATE_MODULE_INTERFACE)
|
||||
set(warning_message "")
|
||||
string(APPEND warning_message
|
||||
"The PRIVATE_MODULE_INTERFACE option was provided the values:"
|
||||
"'${arg_PRIVATE_MODULE_INTERFACE}' "
|
||||
"but there is no ${target}Private target to assign them to."
|
||||
"Ensure the target exists or remove the option.")
|
||||
message(AUTHOR_WARNING "${warning_message}")
|
||||
endif()
|
||||
qt_register_target_dependencies("${target}"
|
||||
"${arg_PUBLIC_LIBRARIES}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue