Report a bugIf you spot a problem with this page, click here to create a Bugzilla issue.
Improve this pageQuickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinga local clone.
dmd.deps
Implement the-deps and-makedeps switches, which output dependencies of modules for build tools.
The grammar of the
-deps output is:
ImportDeclaration ::= BasicImportDeclaration [" : " ImportBindList ] [" -> " ModuleAliasIdentifier ]"\n" BasicImportDeclaration ::= ModuleFullyQualifiedName" (" FilePath") : " Protection|"string"" [ "static" ] : " ModuleFullyQualifiedName" (" FilePath")" FilePath - any stringwith '(', ')' and '\' escaped with the '\' character Make dependencies as generated by
-makedeps look like this:
source/app.d: source/importa.d \ source/importb.d
pure void
writeMakeDeps(ref OutBuffer
buf, ref const Param
params, bool
link, bool
lib, const(char)[]
libExt);
Output the makefile dependencies for the -makedeps switch
Parameters:OutBufferbuf | outbuffer to write into |
Paramparams | dmd params |
boollink | an executable is being generated |
boollib | a library is being generated |
const(char)[]libExt | file extension of libraries for current target |
void
addImportExpDep(ref Output
moduleDeps, ref Output
makeDeps, const(char)[]
fileNameZ, const(char)[]
importString, Module
imod);
Add an import expression to module dependencies
Parameters:OutputmoduleDeps | output settings for-deps |
OutputmakeDeps | output settings for-makedeps |
const(char)[]fileNameZ | 0-termminated string containing the import expression's resolved filename |
const(char)[]importString | raw string passed to import exp |
Moduleimod | module import exp is in |
void
addImportDep(ref Output
moduleDeps, Import
imp, Module
imod);
Add an import statement to module dependencies
Parameters:OutputmoduleDeps | output settings |
Importimp | import to add |
Moduleimod | module that the import is in |
pure void
writeEscapedMakePath(ref OutBuffer
buf, const(char)*
fname);
Takes a path, and make it compatible with GNU Makefile format.
GNU make uses a weird quoting scheme for white space. A space or tab preceded by 2N+1 backslashes represents N backslashes followed by space; a space or tab preceded by 2N backslashes represents N backslashes at the end of a file name; and backslashes in other contexts should not be doubled.
Parameters:OutBufferbuf | Buffer to write the escaped path to |
const(char)*fname | Path to escape |
Examples:version (Windows){enum input =`C:\My Project\file#4$.ext`;enum expected =`C:\My\ Project\file\#4$$.ext`;}else{enum input =`/foo\bar/weird$.:name#\ with spaces.ext`;enum expected =`/foo\bar/weird$$.\:name\#\\\ with\ spaces.ext`;}OutBufferbuf;buf.writeEscapedMakePath(input);assert(buf[] == expected);