Passing macros from commandline or enumerating versions

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 8 06:32:42 PST 2017


On Wednesday, 8 March 2017 at 12:00:40 UTC, Martin DraĊĦar wrote:
> Yeah, that's definitely an option, but I expect to have 
> troubles with DUB if I use this approach.

ugh dub really show offer some way to pass individual modules 
too. Maybe we can request a `--passthrough 
something_to_pass_to_dmd_unmodified` feature.

> Also, I need these files to be json, not a D code, because the 
> same configuration mechanism can be used during runtime and I 
> need to parse these files easily.

You could use the string import feature which is basically the 
same deal on dmd, just do 
`-Jpath/to/specific/config/directory`... but again, not sure if 
dub's command line will let you do that. I know its config file 
will though, "stringImportPaths".

But it would have to be a directory regardless, can't do 
individual files from the command line for string imports.


> So far, I incline to have a build script run separate builds 
> and copying different configuration files to one predefined and 
> hardcode its name into a string import, thus sidestepping the 
> problem.

Yeah, that works too.


More information about the Digitalmars-d-learn mailing list