CMake (Windows): disables usage of WinRT on GCC

Fixes #2341
This commit is contained in:
李通洲
2026-05-23 22:49:04 +08:00
parent 9d5b40686b
commit 3a0e188570
+10 -5
View File
@@ -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)