From 856599d664b26cb5a18011facc6fff4985e65c55 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Sat, 25 May 2024 10:30:17 -0600 Subject: [PATCH] cmake: fix MinGW cross build with CMake > 3.28 --- cmake/MinGWCross.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/MinGWCross.cmake b/cmake/MinGWCross.cmake index dfd3f52..fd44563 100644 --- a/cmake/MinGWCross.cmake +++ b/cmake/MinGWCross.cmake @@ -1,11 +1,14 @@ SET(MINGW_PREFIX /usr/x86_64-w64-mingw32/) SET(CMAKE_SYSTEM_NAME Windows) SET(CMAKE_SYSTEM_PROCESSOR x86_64) -# Actually a hack, w/o this will cause some strange errors -SET(CMAKE_HOST_WIN32 TRUE) +IF(CMAKE_VERSION VERSION_LESS "3.28") + # Actually a hack, w/o this will cause some strange errors + SET(CMAKE_HOST_WIN32 TRUE) +ENDIF() SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX}) +SET(MSYSTEM_PREFIX ${MINGW_PREFIX}) SET(SDL2_PATH ${MINGW_PREFIX}) SET(MINGW_TOOL_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-)