-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMake-MingWcross-toolchain.txt
35 lines (33 loc) · 1.61 KB
/
CMake-MingWcross-toolchain.txt
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
26
27
28
29
30
31
32
33
34
35
# Set the toolchain target-triplet (<arch>-<vendor>-<os>) and the path prefix for the
# toolchain. We want to target 32bit Windows, and use MingW-w64 for this. For most
# Linux distros MingW-w64 is the default Win32 cross-compiler toolchain.
#
# Normally you'd only have to edit these two variables here, if at all. Refer to your
# distro's documentation on how to set up a Linux-to-Windows cross-compiler, and check
# for their naming convention.
#
# Check if your CROSS_CC_NAME is correct by trying to directly
# execute
# /usr/bin/CROSS_CC_NAME-gcc
# (e.g.: /usr/bin/i686-w64-mingw32-gcc)
# If you get an error like "no input files, compilation terminated" then that's the
# *correct* setting. Otherwise, if you see something like "command not found", then it's
# not the correct one yet.
#
# Check if your CROSS_CC_PREFIX is correct by checking whether the file
# CROSS_CC_PREFIX/bin/libstdc++-6.dll
# (e.g.: /usr/i686-w64-ming32/bin/libstdc++-6.dll)
# exists.
SET(CROSS_CC_NAME i686-w64-mingw32)
SET(CROSS_CC_PREFIX /usr/${CROSS_CC_NAME})
# Only edit below here if your setup is a bit out of the ordinary, e.g. not a distro-
# packaged toolchain.
# Let CMake know we want to target Windows
SET(CMAKE_SYSTEM_NAME Windows)
# The tools "gcc", "g++" and "windres" are usually prefixed with the toolchain-triplet,
# i.e. CROSS_CC_NAME, defined above.
# The "-posix" suffix is for the thread API to use. Currently the (default) "-win32"
# version doesn't work on Ubuntu's MingW GCC.
SET(CMAKE_C_COMPILER ${CROSS_CC_NAME}-gcc-posix)
SET(CMAKE_CXX_COMPILER ${CROSS_CC_NAME}-g++-posix)
SET(CMAKE_RC_COMPILER ${CROSS_CC_NAME}-windres)