From 85000766518bac45b712c26511cf4d39c3e845a6 Mon Sep 17 00:00:00 2001 From: genotrance Date: Wed, 24 Oct 2018 06:12:08 -0500 Subject: Make Windows cross-compilation simpler (#9485) --- doc/nimc.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc/nimc.rst') 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 ===================================== -- cgit 1.4.1-2-gfad0