How do I set the output directory for rdmd (Windows)?

I know that in dmd it can be done like this:

> cd ..\bin
> dmd ..\src\example.d

      

or like this:

> dmd example.d -offilename ..\bin\example.exe

      

But in rdmd these methods don't work. The file "example.exe" always appears in the same folder with "example.d".

I tried to do this

> rdmd --build-only example.d ..\bin\example.exe

      

this

> rdmd --build-only example.d -offilename ..\bin\example.exe

      

and this one

> cd ..\bin && rdmd --build-only ..\src\example.d

      

with the same negative result.

+3


source to share


2 answers


You received incorrect syntax -offilename

. filename

is the sample value. You need to replace him -of..\bin\example.exe

. Many other dmd options work the same way.

Also, rdmd does not pass arguments that come after the source file to dmd. They are interpreted as arguments to the program that is built and run (regardless of --build-only

). This means that before example.d

you need to put -of..\bin\example.exe

:



rdmd --build-only -of..\bin\example.exe example.d

+5


source


With the 'of' option, it is assumed that you replace the filename with the name of your output file as follows:

rdmd --build-only -of../bin/example.exe example.d 

      



This works for me in my makefile projects . EDIT: I forgot that the order of the arguments matters with DMD as well.

+3


source







All Articles