dub icon indicating copy to clipboard operation
dub copied to clipboard

Support of dmd compiler switch -mv

Open andre2007 opened this issue 6 years ago • 2 comments
trafficstars

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"]
}

andre2007 avatar Jun 13 '19 09:06 andre2007

For GDC it is -fmodule-file

It should be a map not an array too.

rikkimax avatar Feb 22 '22 12:02 rikkimax

map syntax:

{
    "moduleMappings": {
        "arsd.terminal": "terminal.d"
    }
}

WebFreak001 avatar Feb 22 '22 12:02 WebFreak001