summary refs log tree commit diff stats
path: root/doc/nimc.rst
diff options
context:
space:
mode:
authorgenotrance <dev@genotrance.com>2018-10-24 06:12:08 -0500
committerAndreas Rumpf <rumpf_a@web.de>2018-10-24 13:12:08 +0200
commit85000766518bac45b712c26511cf4d39c3e845a6 (patch)
treeb9949d032ea4bcde3f831d7b66ca524617893620 /doc/nimc.rst
parenteb6225ad8ce0f0d7e7ca834045ed71c2fc457745 (diff)
downloadNim-85000766518bac45b712c26511cf4d39c3e845a6.tar.gz
Make Windows cross-compilation simpler (#9485)
Diffstat (limited to 'doc/nimc.rst')
-rw-r--r--doc/nimc.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/nimc.rst b/doc/nimc.rst
index 0fa2cd038..e1bf98ece 100644
--- a/doc/nimc.rst
+++ b/doc/nimc.rst
@@ -261,6 +261,21 @@ configuration file should contain something like::
   arm.linux.gcc.exe = "arm-linux-gcc"
   arm.linux.gcc.linkerexe = "arm-linux-gcc"
 
+Cross compilation for Windows
+=============================
+
+To cross compile for Windows from Linux or OSX using the MinGW-w64 toolchain::
+
+  nim c -d:mingw myproject.nim
+
+Use ``--cpu:i386`` or ``--cpu:amd64`` to switch the cpu arch.
+
+The MinGW-w64 toolchain can be installed as follows::
+
+  Ubuntu: apt install mingw-w64
+  CentOS: yum install mingw32-gcc | mingw64-gcc - requires EPEL
+  OSX: brew install mingw-w64
+
 Cross compilation for Nintendo Switch
 =====================================