dub
dub copied to clipboard
Support of dmd compiler switch -mv
From DMD compiler info site
-mv=package.module= Use path/filename as the source file for package.module. This is used when the source file path and names are not the same as the package and module hierarchy. The rightmost components of the path/filename and package.module can be omitted if they are the same.
Example:
A folder contains app.d and a sub folder source with file terminal.d.
File terminal.d is defined with module arsd.terminal.
You can compile this scenario using command
dmd -Isource -mv='arsd.terminal=terminal.d' app.d
It should be possible to define these mappings in dub.json / dub.sdl.
Use case is e.g. the dub package arsd-official which causes several issues due to
its layout. Being able to defines theses mappings could solve the issues.
Suggestions:
{
"moduleMappings": ["arsd.terminal=terminal.d"]
}
For GDC it is -fmodule-file
It should be a map not an array too.
map syntax:
{
"moduleMappings": {
"arsd.terminal": "terminal.d"
}
}