DMD(1) The D Language Foundation DMD(1)

dmd - Digital Mars D2.x Compiler

dmd files ... [ -switch ... ]

dmd Compiles source code written in the D programming language.

D source files to compile
D interface files
Object files to link in
Library files to link in
@cmdfile
A file to read more command-line arguments from, which may contain # single-line comments
Generate code for all template instantiations
Omit generating some runtime information and helper functions
Bounds checks on, in @safe only, or off
Compile only, do not link
Enable or disable specific checks
List information on all available checks
Behavior on assert/boundscheck/finalswitch failure
List information on all available check actions
Turn colored console output on
Force colored console output on or off, or only when not redirected (default)
Use config file at filename
Do code coverage analysis
Include code executed during CTFE in coverage report
Require at least nnn% code coverage
Use filename as the name of the C preprocessor to use for ImportC files
Generate documentation
Write documentation file to directory
Write documentation file to filename
Silently allow deprecated features and symbols
Issue an error when deprecated features or symbols are used (halt compilation)
Issue a message when deprecated features or symbols are used (default)
Compile in debug code
Compile in debug code <= level
Compile in debug code identified by ident
Set symbolic debug library to name
Set default library to name
Print module dependencies (imports/file/version/debug/lib)
Write module dependencies to filename (only imports)
Windows only: select symbols to dllimport (none/defaultLibsOnly/all)
Set C++ name mangling compatibility with standard
List all supported standards
Generate Indirect Branch Tracking code
Generate position independent code
Generate position independent executables
Add symbolic debug info
Add DWARF symbolic debug info
Emit debug info for all referenced types
Always emit stack frame
Add stack stomp code
Generate 'header' file
Write 'header' file to directory
Write 'header' file to filename
Write C++ 'header' equivalent to stdout
Write C++ 'header' file to directory
Write C++ 'header' file to filename instead of stdout
Print help and exit
Look for imports also in directory
Include imported modules in the compilation
Deprecated flag, unsupported pragmas are always ignored now
Do function inlining
Look for string imports also in directory
Pass linkerflag to link
Generate library rather than object files
Enable garbage collection for the compiler
Generate 32 bit code
Generate 64 bit code
Add default main() if not present already (e.g. for unittesting)
Print dependencies in Makefile compatible format to filename or stdout.
Open web browser on manual page
Generate linker .map file
Generate instructions for architecture identified by id
List all architecture options
Expand and save mixins to file specified by filename
Use <filespec> as source file for package.module
No array bounds checking (deprecated, use -boundscheck=off)
Assume no Exceptions will be thrown
Optimize
Do not write object file
Write object & library files to directory
Name output file to filename
Preserve source path for output files
Sets target operating system to os
Pass preprocessorflag to C preprocessor
Enable an upcoming language change identified by name
List all upcoming language changes
Profile runtime performance of generated code
Profile runtime allocations
Contracts and asserts are not emitted, and bounds checking is performed only in @safe functions
Revert language change identified by name
List all revertable language changes
Compile, link, and run the program srcfile
Generate shared library (DLL)
Use triple as <arch>-[<vendor>-]<os>[-<cenv>[-<cppenv]]
Help with language change identified by name
List all language changes
Compile in unit tests
Verbose
List generated assembler for each function
Print character (column) numbers in diagnostics
Set the style for file/line number annotations on compiler messages
Limit the number of supplemental messages for each error (0 means unlimited)
Limit the number of error messages (0 means unlimited)
Show error messages with the context of the erroring source line
Show errors from speculative compiles such as __traits(compiles,...)
Print compiler version and exit
Compile in version code >= level
Compile in version code identified by ident
List all gc allocations including hidden ones
Default visibility of symbols (default/hidden/public)
List all variables going into thread local storage
List statistics on template instantiations
Warnings as errors (compilation will halt)
Warnings as messages (compilation will continue)
Warnings about use of obsolete features (compilation will continue)
Generate JSON file
Write JSON file to filename
Pass driverflag to linker driver (cc)

Language changes listed by -transition=id:

List all non-mutable fields which occupy an object instance
Give deprecation messages about all usages of complex or imaginary types
List all variables going into thread local storage
List all usages of 'in' on parameter

Linking is done directly by the dmd compiler after a successful compile. To prevent dmd from running the linker, use the -c switch.

The actual linking is done by running gcc. This ensures compatibility with modules compiled with gcc.

/etc/dmd.conf
System wide dmd config file. See dmd.conf(5) for details.

The D compiler dmd uses the following environment variables:

The value of DFLAGS is treated as if it were appended on the command line to dmd.

Copyright (c) 1999-2024 by The D Language Foundation written by Walter Bright

https://dlang.org/dmd.html

dmd.conf(5) rdmd(1) dumpobj(1) obj2asm(1) gcc(1)

2024-04-08 The D Language Foundation