So okey, I'm on windows, I have 4 toolchains in PATH:
* i686-w64-mingw32-gcc.exe - targeting native Windows i686
* x86_64-w64-mingw32-gcc.exe - targeting native Windows x64
* i686-linux-musl-gcc.exe - targeting Linux i686 from Windows
* x86_64-linux-musl-gcc.exe - targeting Linux x64 from Windows
I have a HelloWorld nim program in test.nim, and I created test.nim.cfg:
i386.windows.gcc.exe = "i686-w64-mingw32-gcc.exe"
i386.windows.gcc.cpp.exe = "i686-w64-mingw32-g++.exe"
amd64.windows.gcc.exe = "x86_64-w64-mingw32-gcc.exe"
amd64.windows.gcc.cpp.exe = "x86_64-w64-mingw32-g++.exe"
i386.linux.gcc.exe = "i686-linux-musl-gcc.exe"
i386.linux.gcc.cpp.exe = "i686-linux-musl-g++.exe"
amd64.linux.gcc.exe = "x86_64-linux-musl-gcc.exe"
amd64.linux.gcc.cpp.exe = "x86_64-linux-musl-g++.exe"
Run
But when I try compiling it with:
nim c -d:release -o:test_win64.exe --os:windows --cpu:amd64 test.nim
nim c -d:release -o:test_win32.exe --os:windows --cpu:i386 test.nim
nim c -d:release -o:test_lin64.elf --os:linux --cpu:amd64 test.nim
nim c -d:release -o:test_lin32.elf --os:linux --cpu:i386 test.nim
Run
the Nim's compiler keeps calling gcc.exe for everything, what am I doing wrong
here?