1if(NOT HOST_ARCH)
2  message(SEND_ERROR "-DHOST_ARCH required to be specified")
3endif()
4
5list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
6  HOST_ARCH
7  )
8
9SET(CMAKE_SYSTEM_NAME Windows)
10set(COMPILER_PREFIX "${HOST_ARCH}-w64-mingw32")
11find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
12find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
13find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
14
15set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
16set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
17set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
18