From 5776865f7c6b234f66512eab41c871662449d80d Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Mon, 28 Apr 2025 12:42:02 +0300 Subject: [PATCH] Compile calendarbackendplugin only if widgets are enabled The example links against widgets unconditionally => add proper build-time guard Task-number: QTBUG-136101 Pick-to: 6.9 Change-Id: I62ea42a04f7ff421753a0fc7a30cd969cfaff6e2 Reviewed-by: Magdalena Stojek Reviewed-by: Edward Welbourne --- examples/corelib/time/CMakeLists.txt | 4 +++- examples/corelib/time/time.pro | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/corelib/time/CMakeLists.txt b/examples/corelib/time/CMakeLists.txt index 148ae5d0148..620c5c32ac7 100644 --- a/examples/corelib/time/CMakeLists.txt +++ b/examples/corelib/time/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (C) 2024 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -qt_internal_add_example(calendarbackendplugin) +if(QT_FEATURE_widgets) + qt_internal_add_example(calendarbackendplugin) +endif() diff --git a/examples/corelib/time/time.pro b/examples/corelib/time/time.pro index 4d24416e345..bae84a35142 100644 --- a/examples/corelib/time/time.pro +++ b/examples/corelib/time/time.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs CONFIG += no_docs_target -SUBDIRS = calendarbackendplugin +qtHaveModule(widgets): SUBDIRS = calendarbackendplugin