In addition to the many gcc options controlling code generation,
gdc has several options specific to itself.
-HGenerates D interface files for all modules being compiled. The compiler determines the output file based on the name of the input file, removes any directory components and suffix, and applies the .di suffix.
-Hd dirSame as -H, but writes interface files to directory dir. This option can be used with -Hf file to independently set the output file and directory path.
-Hf fileSame as -H but writes interface files to file. This option can be used with -Hd dir to independently set the output file and directory path.
-MOutput the module dependencies of all source files being compiled in a
format suitable for make. The compiler outputs one
make rule containing the object file name for that source file,
a colon, and the names of all imported files.
-MMLike -M but does not mention imported modules from the D standard library package directories.
-MF fileWhen used with -M or -MM, specifies a file to write the dependencies to. When used with the driver options -MD or -MMD, -MF overrides the default dependency output file.
-MGThis option is for compatibility with gcc, and is ignored by the
compiler.
-MPOutputs a phony target for each dependency other than the modules being compiled, causing each to depend on nothing.
-MT targetChange the target of the rule emitted by dependency generation to be exactly the string you specify. If you want multiple targets, you can specify them as a single argument to -MT, or use multiple -MT options.
-MQ targetSame as -MT, but it quotes any characters which are special to
make.
-MDThis option is equivalent to -M -MF file. The driver determines file by removing any directory components and suffix from the input file, and then adding a .deps suffix.
-MMDLike -MD but does not mention imported modules from the D standard library package directories.
-XOutput information describing the contents of all source files being compiled in JSON format to a file. The driver determines file by removing any directory components and suffix from the input file, and then adding a .json suffix.
-Xf fileSame as -X, but writes all JSON contents to the specified file.
-fdocGenerates Ddoc documentation and writes it to a file. The compiler
determines file by removing any directory components and suffix
from the input file, and then adding a .html suffix.
-fdoc-dir=dirSame as -fdoc, but writes documentation to directory dir. This option can be used with -fdoc-file=file to independently set the output file and directory path.
-fdoc-file=fileSame as -fdoc, but writes documentation to file. This option can be used with -fdoc-dir=dir to independently set the output file and directory path.
-fdoc-inc=fileSpecify file as a Ddoc macro file to be read. Multiple -fdoc-inc options can be used, and files are read and processed in the same order.
-fdump-c++-spec=fileFor D source files, generate corresponding C++ declarations in file.
-fdump-c++-spec-verboseIn conjunction with -fdump-c++-spec= above, add comments for ignored declarations in the generated C++ header.
-fsave-mixins=fileGenerates code expanded from D mixin statements and writes the
processed sources to file. This is useful to debug errors in compilation
and provides source for debuggers to show when requested.