programmatically get -I and -L flags from dmd; dmd.conf should prepend instead of append?

Timothee Cour via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 28 06:50:14 PST 2015


I'd like to have a command line flag for dmd (and ldc,gdc) that would be
the analog to:
llvm-config --ldflags --cflags
ie, would print the corresponding flags used by dmd after following the
internal logic (look for dmd.conf in a number of directories, look for
DFLAGS environment variable etc).

one use case among others:

when using 'dmd -L-Lfoo -lbar ...', i'd like to first guess which linker
flags are used by dmd (eg transforming -L-L%@P% into -L-Lsome_path) and
then call:
'dmd -L-Lsome_path -L-Lfoo -lbar ...'

Note that what's actually called is instead:
'dmd -L-Lfoo -lbar ... -L-Lsome_path '
ie, dmd appends instead of prepends the library search path given by
dmd.conf, which leads to weird behavior if foo (from -L-Lfoo) contains an
unwanted version of libphobos2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20151228/de293fad/attachment-0001.html>


More information about the Digitalmars-d mailing list