Hello, is there a way to specify the working directory of the compiler (e.g. gcc) in nim.cfg. That is because I don't want to add Mingw-w64 (threads-posix) to the global PATH variable on Windows.
Setting "gcc.path" only tells nim the path to the binary itself but it's not being used as working dir (for good reasons).
Actually the problem is more related to gcc of Mingw-w64 (posix-threads). When you run gcc from the command line on Windows without it being in PATH cc1.exe (not in gcc dir) fails because it requires libwinpthread-1.dll (among others) which resides in the gcc dir. It works fine for Mingw-w64 (win32-threads) though since cc1.exe has no further dependencies.
And I cannot add Mingw to PATH because it would mess up my build environment when I'm also using other versions of Mingw. So setting the working dir to the same as gcc.path seems like a proper fix to me.
The usual solution to this is to have a "special" batch file that you run when you want to use an alternative build environment. The batch file modifies the PATH variable (by using set), then launches a sub-command prompt.
Since set only does modifications to the current prompt's environment, the changes are temporary, and limited to the command prompt which is launched by the bash script
I thought exactly that is the purpose of nim configuration files (global or on project level) where you can configure different build types (cpu, compiler, debug/release, etc.) Other build systems or IDEs that are calling Mingw do not have that problem.
So I'm assuming the answer to the original question is: no.