A DUB Case Study: Compiling DMD as a Library

Jacob Carlborg doob at me.com
Wed Dec 20 10:03:14 UTC 2017


On 2017-12-20 05:52, Venkat wrote:
> 
> This is regarding the latest D blog post. Jacob Carlborg is here, so I 
> figured I'd post it.
> 
> https://dlang.org/blog/2017/08/01/a-dub-case-study-compiling-dmd-as-a-library/#comment-2922 
> 
> 
> Simply changing the targetType from library to dynamicLibrary breaks the 
> code. What is going on with it ?
> 
> --dub.sdl--
> name "dmd-dub-test"
> description "Test of the DMD Dub package"
> license "BSL 1.0"
> 
> sourcePaths "."
> targetType "library"
> dependency "dmd" path="../DSource/dmd/"
> --end dub.sdl--
> 
> -- output --
> venkat at venkat-U46E /d/Documents/NetbeansProjects/dmd-test $ dub build
> Performing "debug" build using dmd for x86_64.
> -- end output --
> 
> --dub.sdl--
> name "dmd-dub-test"
> description "Test of the DMD Dub package"
> license "BSL 1.0"
> 
> sourcePaths "."
> targetType "dynamicLibrary"
> dependency "dmd" path="../DSource/dmd/"
> --end dub.sdl--
> 
> Performing "debug" build using dmd for x86_64.
> dmd ~stable: building configuration "library"...
> ../DSource/dmd/src/ddmd/scanmscoff.d(180,10): Error: undefined 
> identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(181,10): Error: undefined 
> identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(182,10): Error: undefined 
> identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(183,10): Error: undefined 
> identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(184,11): Error: undefined 
> identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(185,15): Error: undefined 
> identifier BYTE
> ../DSource/dmd/src/ddmd/scanmscoff.d(185,15): Error: undefined 
> identifier BYTE
> ../DSource/dmd/src/ddmd/scanmscoff.d(187,14): Error: undefined 
> identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(187,14): Error: undefined 
> identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(188,11): Error: undefined 
> identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(189,11): Error: undefined 
> identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(190,11): Error: undefined 
> identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(196,11): Error: undefined 
> identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(197,11): Error: undefined 
> identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(198,11): Error: undefined 
> identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(199,11): Error: undefined 
> identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(200,11): Error: undefined 
> identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(201,11): Error: undefined 
> identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(202,11): Error: undefined 
> identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(225,24): Error: undefined 
> identifier BYTE
> dmd failed with exit code 1.

Looks like it's trying to build all files again, even though it 
shouldn't. I suggest you run "dub build --force --vverbose" to see the 
exact commands that Dub is executing.

For me it works both with "library" and "dynamicLibrary".

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list