How do I statically build a project using DUB?

Mike Parker aldacron at gmail.com
Sun Aug 30 04:27:39 UTC 2020


On Sunday, 30 August 2020 at 02:38:52 UTC, Kirill wrote:

>
> I am trying to link the GTK library. I have the GTK Runtime 
> installed on Windows 10 pc.


Unless things have changed in the last few years, GTK is not 
intended to be linked statically on Windows. You'll have to 
figure out how to compile it yourself as a static library. I 
recall reading about this a while back. IIRC, there were also 
some source changes required.

Then there's also the matter of licensing. GTK is released under 
the LGPL, which means if you statically link then your executable 
is considered a derivative work and must abide by the 
distribution terms of the LGPL.

>
> Do I need to build the static GTK library from the source? Then 
> how do I tell DUB to include that library?

DUB has a "libs" directive in the build settings:

https://dub.pm/package-format-sdl.html#build-settings
https://dub.pm/package-format-json.html#build-settings


More information about the Digitalmars-d-learn mailing list