toolchain-mingw-w64.cmake 814 B

1234567891011121314151617181920212223
  1. set(CMAKE_SYSTEM_NAME Windows)
  2. set(CMAKE_SYSTEM_VERSION 1)
  3. set(CMAKE_SYSTEM_PROCESSOR x86_64)
  4. set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
  5. # cross compilers to use for C and C++
  6. set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
  7. set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
  8. set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
  9. # target environment on the build host system
  10. set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
  11. # modify default behavior of FIND_XXX() commands to
  12. # search for headers/libs in the target environment and
  13. # search for programs in the build host environment
  14. set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  15. set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  16. set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
  17. set(CMAKE_EXE_LINKER_FLAGS_INIT "-static-libgcc -static-libstdc++")
  18. set(CMAKE_CROSS_COMPILING TRUE)