]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/buildsrc/toolchain-x86_64-w64-mingw32.cmake
Fix macOS SDL2 framework permissions
[xonotic/xonotic.git] / misc / buildsrc / toolchain-x86_64-w64-mingw32.cmake
1 # Sample toolchain file for building for Windows from an Ubuntu Linux system.
2 #
3 # Typical usage:
4 #    *) install cross compiler: `sudo apt-get install mingw-w64 g++-mingw-w64`
5 #    *) cd build
6 #    *) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-Ubuntu-mingw64.cmake ..
7
8 set(CMAKE_SYSTEM_NAME Windows)
9 set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
10
11 # cross compilers to use for C and C++
12 set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
13 set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
14 set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
15
16 # target environment on the build host system
17 #   set 1st to dir with the cross compiler's C/C++ headers/libs
18 set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
19
20 # modify default behavior of FIND_XXX() commands to
21 # search for headers/libs in the target environment and
22 # search for programs in the build host environment
23 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
24 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
25 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)