From 3a0e188570376c8b9f556e97f3647cf7c8ab6e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 23 May 2026 22:49:04 +0800 Subject: [PATCH] CMake (Windows): disables usage of WinRT on GCC Fixes #2341 --- CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 28d8b1f20..368dcb44d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1341,12 +1341,17 @@ if(WIN32) list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_intel.c) list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_amd.c) - include(CheckIncludeFileCXX) - CHECK_INCLUDE_FILE_CXX("winrt/Windows.Foundation.h" HAVE_WINRT) - if(HAVE_WINRT) - message(STATUS "WinRT headers are available, media detection will be enabled") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + message(STATUS "WinRT support is disabled due to known issues with g++") + set(HAVE_WINRT FALSE) else() - message(WARNING "WinRT headers are NOT available, media detection will be disabled") + include(CheckIncludeFileCXX) + CHECK_INCLUDE_FILE_CXX("winrt/Windows.Foundation.h" HAVE_WINRT) + if(HAVE_WINRT) + message(STATUS "WinRT headers are available, media detection will be enabled") + else() + message(WARNING "WinRT headers are NOT available, media detection will be disabled") + endif() endif() endif() include(CheckFunctionExists)