[dub] Passing --DRT-gcopt to dmd

Mike Parker aldacron at gmail.com
Fri May 31 10:47:20 UTC 2019


On Friday, 31 May 2019 at 10:27:44 UTC, Anonymouse wrote:

> What is the correct way?

--DRT flags are for run time, not compile time. They're intended 
to be passed to your executable and not the compiler. From the 
docs [1]:

"By default, GC options can only be passed on the command line of 
the program to run"

With dub, anything following a solitary -- on the command line 
will be passed to the application [2], so you probably want 
something like this:

dub test -- --DRT-gcopt=profile:1

[1] https://dlang.org/spec/garbage.html#gc_config
[2] https://dub.pm/commandline


More information about the Digitalmars-d-learn mailing list