Randy Abernethy | ded6401 | 2015-02-15 11:28:40 -0800 | [diff] [blame] | 1 | # CMake mingw32 cross compile toolchain file |
| 2 | |
| 3 | # the name of the target operating system |
| 4 | SET(CMAKE_SYSTEM_NAME Windows) |
| 5 | |
| 6 | # which compilers to use for C and C++ |
| 7 | SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc) |
| 8 | SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++) |
| 9 | SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres) |
| 10 | |
| 11 | # here is the target environment located |
| 12 | SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc) |
| 13 | |
| 14 | # adjust the default behaviour of the FIND_XXX() commands: |
| 15 | # search headers and libraries in the target environment, search |
| 16 | # programs in the host environment |
| 17 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
| 18 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) |
| 19 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
Roger Meier | e46ec45 | 2015-05-17 00:35:52 +0200 | [diff] [blame] | 20 | |
| 21 | set(BUILD_SHARED_LIBS OFF) |
| 22 | SET(CMAKE_EXE_LINKER_FLAGS "-static") |
| 23 | set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-static-libgcc") |
| 24 | set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-static-libstdc++") |