summaryrefslogtreecommitdiffhomepage
path: root/cmake/toolchains/i686-w64-mingw32.cmake
blob: b4d66ebc89716959adb9e80f3f4d97a4dc0f25ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# You need to have MinGW installed in /usr/i686-w64-mingw32 to use this toolchain without changes.
# Use it with e.g. command line option:
#
#     $ cmake .. --toolchain=../cmake/toolchains/i686-w64-mingw32.cmake
#
# Or use CMAKE_TOOLCHAIN_FILE variable.

set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR i686)
set(CMAKE_CROSSCOMPILING ON)
set(TOOLCHAIN_DIR "${CMAKE_CURRENT_LIST_DIR}")

set(CMAKE_CROSSCOMPILING_EMULATOR "${TOOLCHAIN_DIR}/i686-w64-mingw32-wine")

set(TOOLCHAIN_PREFIX i686-w64-mingw32)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
set(CMAKE_MC_COMPILER ${TOOLCHAIN_PREFIX}-windmc)

set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)