where to look for
imports.
path is a ; separated
list of paths. Multiple -I's can be used, and the paths
are searched in the same order.

-ignore

ignore unsupported pragmas

-inline

inline expand functions at the discretion of the compiler.
This can improve performance, at the expense of making
it more difficult to use a debugger on it.

-Jpath

where to look for files for
ImportExpressions.
This switch is required in order to use ImportExpressions.
path is a ; separated
list of paths. Multiple -J's can be used, and the paths
are searched in the same order.

-Llinkerflag

pass linkerflag to the
linker, for example,
-L-M

-lib

generate library file as output instead of object file(s).
All compiled source files, as well as object files and library
files specified on the command line, are inserted into
the output library.
Compiled source modules may be partitioned into several object
modules to improve granularity.
The name of the library is taken from the name of the first
source module to be compiled. This can be overridden with
the -of switch.

-m32

compile a 32 bit executable. This is the default for the
32 bit dmd.

-m64

compile a 64 bit executable. This is the default for the 64 bit dmd.

-man

open browser specified by the BROWSER
environment variable on this page. If BROWSER is
undefined, Safari is assumed.

The dmd file dmd.conf is the same as sc.ini
for Windows, it's just that the file has a different name,
enabling a setup common to both Windows and this system to be created
without having to re-edit the file.

dmd will look for the initialization file dmd.conf in the
following sequence of directories:

current working directory

directory specified by the HOME environment variable

directory dmd resides in

/etc/

If found, environment variable
settings in the file will override any existing settings.
This is handy to make dmd independent of programs with
conflicting use of environment variables.

Environment variables follow the [Environment] section
heading, in NAME=value pairs.
The NAMEs are treated as upper case.
Comments are lines that start with ;.
For example:

; dmd.conf file for dmd
; Names enclosed by %% are searched for in the existing environment
; and inserted. The special name %@P% is replaced with the path
; to this file.
[Environment]
DFLAGS=-I%@P%/../src/phobos

When an import declaration is processed in a D source file,
the compiler searches for the D source file corresponding to
the import, and processes that source file to extract the
information needed from it. Alternatively, the compiler can
instead look for a corresponding D interface file.
A D interface file contains only what an import of the module
needs, rather than the whole implementation of that module.

The advantages of using a D interface file for imports rather
than a D source file are:

D interface files are often significantly smaller and much
faster to process than the corresponding D source file.

They can be used to hide the source code, for example,
one can ship an object code library along with D interface files
rather than the complete source code.

D interface files can be created by the compiler from a
D source file by using the -H switch to the compiler.
D interface files have the .di file extension.
When the compiler resolves an import declaration, it first looks
for a .di D interface file, then it looks for a D source
file.

D interface files bear some analogous similarities to C++
header files. But they are not required in the way that C++
header files are, and they are not part of the D language.
They are a feature of the compiler, and serve only as an optimization
of the build process.

There are three ways to build a library. For example,
given foo.d and bar.d which are to be compiled, and existing
object file bar.o and existing library
def.a which are
all to be combined into a library foo.a:

No object files are written to disk, it's all done in memory.
Using -lib also has the advantage that modules may be compiled
into multiple object files rather than exactly one per module.
This improves granularity of the library without having to break
up the modules.