When compiling is there a way to specify an output directory for the binary that is produced? for example I am trying to do something like this:
nim c -d:release source.nim some_directory_here
I bet there is a way I just can't find the command/options in the manual: https://nim-lang.org/docs/nimc.html
thanks!
Advanced options:
-o, --out:FILE set the output filename
This option?
Yeah I did try the '-o' option, and zolern is right it does just expect a file name. The -o option is just to change the name of binary. when I specify a path to -o it just ignores the path given to it and names the binary whatever the source file is named. I tried running the -o option like this:
nim --run c main.nim -o ../bin/program
and it returns a binary named main.You need to put the compiler arguments before the source file otherwise it takes them to be arguments to the binary for the run command. This should work
nim --run c -o:../bin/program main.nim
I like having a little compiler wrapper to execute nim just the way I like it. I wrote one for my needs called nimr [pb], but I think most programmers will want to write their own rather than deal with my fugly old code.
Some features include: