solvespace/cmake/Toolchain-mingw64.cmake
whitequark 0159a87a8a Add support for cross-compiling from Linux.
As a side effect, zlib and libpng are now git submodules,
based on their respective official git repositories.
This is necessary, because MinGW has a different ABI and
it cannot use the prebuilt binaries built by MSVC.

The submodules are also used for Windows, for several reasons:
  * to allow 64-bit builds;
  * to allow using newer MSVC, which doesn't like the prebuilt
    libraries;
  * to keep the libraries updated.
2015-07-10 15:59:12 +03:00

14 lines
355 B
CMake

SET(CMAKE_SYSTEM_NAME Windows)
SET(TRIPLE x86_64-w64-mingw32)
SET(CMAKE_C_COMPILER ${TRIPLE}-gcc)
SET(CMAKE_CXX_COMPILER ${TRIPLE}-g++)
SET(CMAKE_RC_COMPILER ${TRIPLE}-windres)
SET(CMAKE_FIND_ROOT_PATH /usr/${TRIPLE})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)