Check the QTP0002 policy only if paths are set

It doesn't make sense to disturb users with the policy warning if they
don't specify Android paths. Suppress the policy check if Android
paths are not set for the target.

Fixes: QTBUG-115119
Pick-to: 6.6
Change-Id: Ice9d0459c01feb505857133bb942b1b6e775e55a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
bb10
Alexey Edelev 2023-07-19 17:57:01 +02:00
parent 056e127ff6
commit 575b8a7fa2
1 changed files with 22 additions and 0 deletions

View File

@ -901,6 +901,28 @@ function(_qt_internal_android_format_deployment_paths target)
if(QT_BUILD_STANDALONE_TESTS OR QT_BUILDING_QT OR QT_INTERNAL_IS_STANDALONE_TEST)
set(android_deployment_paths_policy NEW)
else()
set(policy_path_properties
QT_QML_IMPORT_PATH
QT_QML_ROOT_PATH
QT_ANDROID_PACKAGE_SOURCE_DIR
QT_ANDROID_EXTRA_PLUGINS
QT_ANDROID_EXTRA_LIBS
)
# Check if any of paths contains the value and stop the evaluation if all properties are
# empty or -NOTFOUND
set(has_android_paths FALSE)
foreach(prop_name IN LISTS policy_path_properties)
get_target_property(prop_value ${target} prop_name)
if(prop_value)
set(has_android_paths TRUE)
break()
endif()
endforeach()
if(NOT has_android_paths)
return()
endif()
__qt_internal_setup_policy(QTP0002 "6.6.0"
"Target properties that specify android-specific paths may contain generator\
expressions but they must evaluate to valid JSON strings.\