summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-02-06 18:18:41 +0100
committerAki <please@ignore.pl>2022-02-06 18:18:41 +0100
commitba64478a1aa1740da47ff0016dff6cc633900b73 (patch)
tree2eabdee9ca424ee89f72f27a2e231ed812cd5caa /cmake
parent94ee5c56cde7074fa9dee7ae00baf9a26bda4a6e (diff)
downloadstarshatter-ba64478a1aa1740da47ff0016dff6cc633900b73.zip
starshatter-ba64478a1aa1740da47ff0016dff6cc633900b73.tar.gz
starshatter-ba64478a1aa1740da47ff0016dff6cc633900b73.tar.bz2
Added default toolchain for linux cross-compilation
Diffstat (limited to 'cmake')
-rw-r--r--cmake/toolchains/i686-w64-mingw32.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/cmake/toolchains/i686-w64-mingw32.cmake b/cmake/toolchains/i686-w64-mingw32.cmake
new file mode 100644
index 0000000..30df69e
--- /dev/null
+++ b/cmake/toolchains/i686-w64-mingw32.cmake
@@ -0,0 +1,24 @@
+# You need to have MinGW installed in /usr/i686-w64-mingw32 to use this toolchain without changes.
+# Use it with e.g. command line option:
+#
+# $ cmake .. --toolchain=../cmake/toolchains/i686-w64-mingw32.cmake
+#
+# Or use CMAKE_TOOLCHAIN_FILE variable.
+
+set(CMAKE_SYSTEM_NAME Windows)
+set(CMAKE_CROSSCOMPILING ON)
+
+find_program(WINE wine)
+if(WINE)
+ set(CMAKE_CROSSCOMPILING_EMULATOR ${WINE})
+endif()
+
+set(TOOLCHAIN_PREFIX i686-w64-mingw32)
+set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
+set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
+set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
+
+set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_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) \ No newline at end of file