From f71eb4a6426fe7174d28f733c79142b595c21808 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Tue, 9 May 2023 14:45:46 +0200 Subject: [PATCH] Avoid littering CMake logs with QTP0002 warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It doesn't make any sense to setup and get policy when we build either Qt or standalone tests, since the value will be ignored anyway. So skip the policy setup for Qt builds to avoid littering the CMake logs with QTP0002 warnings. Amends c4debab927671de802d377f31e4fff4136da9104 Change-Id: Iacae8f9ecbb6c9da2f3af77b2016454c8d4194e6 Reviewed-by: Assam Boudjelthia Reviewed-by: Tor Arne Vestbø Reviewed-by: Edward Welbourne Reviewed-by: Qt CI Bot --- src/corelib/Qt6AndroidMacros.cmake | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 280b6794040..252332676b8 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -887,14 +887,17 @@ endfunction() # It doesn't overwrite public properties, but instead writes formatted values to internal # properties. function(_qt_internal_android_format_deployment_paths target) - __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.\ - Check https://doc.qt.io/qt-6/qt-cmake-policy-qtp0002.html for policy details." - ) - qt6_policy(GET QTP0002 android_deployment_paths_policy) - if(QT_BUILD_STANDALONE_TESTS OR QT_BUILDING_QT OR - android_deployment_paths_policy STREQUAL "NEW") + if(QT_BUILD_STANDALONE_TESTS OR QT_BUILDING_QT) + set(android_deployment_paths_policy NEW) + else() + __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.\ + Check https://doc.qt.io/qt-6/qt-cmake-policy-qtp0002.html for policy details." + ) + qt6_policy(GET QTP0002 android_deployment_paths_policy) + endif() + if(android_deployment_paths_policy STREQUAL "NEW") # When building standalone tests or Qt itself we obligate developers to not use # windows paths when setting QT_* properties below, so their values are used as is when # generating deployment settings.