Why is DUB not passing dll.def file to linker
Igor via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat May 20 13:26:29 PDT 2017
On Saturday, 20 May 2017 at 20:04:27 UTC, Mike Parker wrote:
> On Saturday, 20 May 2017 at 19:53:16 UTC, Igor wrote:
>>
>> There is no mention of dll.def file.
>
> Add a "sourceFiles" directive:
>
> "sourceFiles-windows" : ["dll.def"]
>
> See the comments at the following:
>
> https://github.com/dlang/dub/issues/575
> https://github.com/dlang/dub/pull/399
Thanks Mike. Google wasn't this helpful :). In the meantime I
tried debugging dub to see what is happening and with this simple
change in packagerecipe.d it seems to work:
// collect source files (instead of just "*.d" i put the
following at line 206)
dst.addSourceFiles(collectFiles(sourcePaths, "*.{d,def}"));
This is the output I got:
Performing "debug" build using dmd for x86_64.
handmade ~master: building configuration "internal"...
FILES IN BUILDSETTINGS: ["dll.def", "handmade.d", "handmade_h.d",
"windll.d"]
dmd -m64 -c
-of.dub\build\internal-debug-windows-x86_64-dmd_2074-C56D6B49201C03F44B01E754688EACEE\handmade.obj -debug -g -w -version=HANDMADE_INTERNAL -version=Have_handmade handmade.d handmade_h.d windll.d -vcolumns
Linking...
dmd
-of.dub\build\internal-debug-windows-x86_64-dmd_2074-C56D6B49201C03F44B01E754688EACEE\handmade.dll .dub\build\internal-debug-windows-x86_64-dmd_2074-C56D6B49201C03F44B01E754688EACEE\handmade.obj dll.def -m64 -shared -g
As you can see def file just got added to link command.
So my question is if the fix is so simple what are the reasons it
isn't implemented? Am I missing something?
More information about the Digitalmars-d-learn
mailing list