From 09953c433221f6a974a83e39398eb1911905d82f Mon Sep 17 00:00:00 2001 From: Yuhang Zhao Date: Sun, 8 Oct 2023 09:44:54 +0800 Subject: [PATCH] cmake: use a more appropriate feature guard The factory cache registration functionality should belong to the cppwinrt feature, so guard it with appropriate QT_FEATURE_ guard. Change-Id: Icbadaa7ffb32a4e47fe3bbab90c37303fd787344 Reviewed-by: Alexandru Croitor --- src/corelib/CMakeLists.txt | 2 +- src/plugins/platforms/windows/qwindowscontext.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index b52c994c5e4..c43210c2f4f 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -1013,7 +1013,7 @@ qt_internal_extend_target(Core CONDITION ANDROID # place to put them. ) -qt_internal_extend_target(Core CONDITION WIN32 +qt_internal_extend_target(Core CONDITION QT_FEATURE_cpp_winrt SOURCES platform/windows/qfactorycacheregistration_p.h platform/windows/qfactorycacheregistration.cpp diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 8da9710cc62..3776fe63c17 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -45,7 +45,9 @@ #include #include #include -#include +#if QT_CONFIG(cpp_winrt) +# include +#endif #include #include