nimxc
is a command-line utility that makes it really easy to cross-compile Nim
programs. This is ALPHA quality software!
nimble install https://github.com/iffy/nimxc.git
# Compile `foo.nim` for 64-bit Linux
nimxc c --target linux-amd64 foo.nim
# or Intel macOS
nimxc c --target macosx-amd64 foo.nim
# or M1 macOS
nimxc c --target macosx-arm64 foo.nim
# see more
nimxc --help
The following hosts and targets are supported except for some situations captured in Issues.
Some dynamic libraries aren't working yet.
Generated from running nimxc list --all
:
From linux-amd64
--target linux-amd64
--target linux-amd64-gnu.2.27
--target linux-amd64-gnu.2.28
--target linux-amd64-gnu.2.31
--target linux-i386
--target macosx-amd64
--target macosx-arm64
--target windows-amd64
--target windows-arm64
--target windows-i386
From linux-i386
--target linux-amd64
--target linux-amd64-gnu.2.27
--target linux-amd64-gnu.2.28
--target linux-amd64-gnu.2.31
--target linux-i386
--target macosx-amd64
--target macosx-arm64
--target windows-amd64
--target windows-arm64
--target windows-i386
From macosx-amd64
--target linux-amd64
--target linux-amd64-gnu.2.27
--target linux-amd64-gnu.2.28
--target linux-amd64-gnu.2.31
--target linux-i386
--target macosx-amd64
--target macosx-arm64
--target windows-amd64
--target windows-arm64
--target windows-i386
From macosx-arm64
--target linux-amd64
--target linux-amd64-gnu.2.27
--target linux-amd64-gnu.2.28
--target linux-amd64-gnu.2.31
--target linux-i386
--target macosx-amd64
--target macosx-arm64
--target windows-amd64
--target windows-arm64
--target windows-i386
From windows-amd64
--target linux-amd64
--target linux-amd64-gnu.2.27
--target linux-amd64-gnu.2.28
--target linux-amd64-gnu.2.31
--target linux-i386
--target macosx-amd64
--target macosx-arm64
--target windows-amd64
--target windows-arm64
--target windows-i386
From windows-arm64
--target linux-amd64
--target linux-amd64-gnu.2.27
--target linux-amd64-gnu.2.28
--target linux-amd64-gnu.2.31
--target linux-i386
--target macosx-amd64
--target macosx-arm64
--target windows-amd64
--target windows-arm64
--target windows-i386
From windows-i386
--target linux-amd64
--target linux-amd64-gnu.2.27
--target linux-amd64-gnu.2.28
--target linux-amd64-gnu.2.31
--target linux-i386
--target macosx-amd64
--target macosx-arm64
--target windows-amd64
--target windows-arm64
--target windows-i386
It uses zig cc
as the compiler. Thanks, Zig!