Options for Directory Search#
These options specify directories to search for files, libraries, and other parts of the compiler:
- -Idir#
Specify a directory to use when searching for imported modules at compile time. Multiple
-Ioptions can be used, and the paths are searched in the same order.
- -Jdir#
Specify a directory to use when searching for files in string imports at compile time. This switch is required in order to use
import(file)expressions. Multiple-Joptions can be used, and the paths are searched in the same order.
- -Ldir#
When linking, specify a library search directory, as with gcc.
- -Bdir#
This option specifies where to find the executables, libraries, source files, and data files of the compiler itself, as with gcc.
- -fmodule-file=module=spec#
This option manipulates file paths of imported modules, such that if an imported module matches all or the leftmost part of
module, the file path inspecis used as the location to search for D sources. This is used when the source file path and names are not the same as the package and module hierarchy. Consider the following examples:gdc test.d -fmodule-file=A.B=foo.d -fmodule-file=C=bar
This will tell the compiler to search in all import paths for the source file
foo.dwhen importingA.B, and the directorybar/when importingC, as annotated in the following D code:module test; import A.B; // Matches A.B, searches for foo.d import C.D.E; // Matches C, searches for bar/D/E.d import A.B.C; // No match, searches for A/B/C.d
- -imultilib dir#
Use
diras a subdirectory of the gcc directory containing target-specific D sources and interfaces.
- -iprefix prefix#
Specify
prefixas the prefix for the gcc directory containing target-specific D sources and interfaces. If theprefixrepresents a directory, you should include the final'/'.