Skip to content

Commit

Permalink
cmake: fix MinGW cross build with CMake > 3.28
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuyu authored and cthbleachbit committed Jun 1, 2024
1 parent cf52972 commit 856599d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmake/MinGWCross.cmake
Original file line number Diff line number Diff line change
@@ -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-)

Expand Down

0 comments on commit 856599d

Please sign in to comment.