Browse Source

Add mingw cmake toolchain files

Samuel Čavoj 3 years ago
parent
commit
632588d00e
3 changed files with 29 additions and 2 deletions
  1. 1 2
      .gitignore
  2. 14 0
      cmake/i686-w64-mingw32.cmake
  3. 14 0
      cmake/x86_64-w64-mingw32.cmake

+ 1 - 2
.gitignore

@@ -1,4 +1,3 @@
 /legacy/
 /.vscode/
-/build
-/build-win
+/build*

+ 14 - 0
cmake/i686-w64-mingw32.cmake

@@ -0,0 +1,14 @@
+SET(CMAKE_SYSTEM_NAME Windows)
+SET(CMAKE_SYSTEM_VERSION 1)
+
+SET(MINGW_PREFIX "i686-w64-mingw32")
+
+SET(CMAKE_C_COMPILER     "${MINGW_PREFIX}-gcc")
+SET(CMAKE_CXX_COMPILER   "${MINGW_PREFIX}-g++")
+SET(CMAKE_RC_COMPILER    "${MINGW_PREFIX}-windres")
+SET(CMAKE_RANLIB         "${MINGW_PREFIX}-ranlib")
+
+SET(CMAKE_FIND_ROOT_PATH "/usr/${MINGW_PREFIX}")
+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

+ 14 - 0
cmake/x86_64-w64-mingw32.cmake

@@ -0,0 +1,14 @@
+SET(CMAKE_SYSTEM_NAME Windows)
+SET(CMAKE_SYSTEM_VERSION 1)
+
+SET(MINGW_PREFIX "x86_64-w64-mingw32")
+
+SET(CMAKE_C_COMPILER     "${MINGW_PREFIX}-gcc")
+SET(CMAKE_CXX_COMPILER   "${MINGW_PREFIX}-g++")
+SET(CMAKE_RC_COMPILER    "${MINGW_PREFIX}-windres")
+SET(CMAKE_RANLIB         "${MINGW_PREFIX}-ranlib")
+
+SET(CMAKE_FIND_ROOT_PATH "/usr/${MINGW_PREFIX}")
+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)