23.12.2013 15:04, Russel Winder пишет:
For my (very) early stage GtkD program, my SCons script (using "all
source at once") generates a 6MB executable that works. Dub appears to
think that it is creating a .a archive and create 142MB of it. So how to
create an executable with Dub?
I statically build GtkD application using dub and it gives me binary
about 14 Mb in debug mode and stripped binary is about 8 or 6 Mb. But I
built GtkD separately and link against it using the following package.json:
{
"name": "renderer",
"targetType": "library",
"versions": [
"Derelict3",
"gl3n",
],
"libs": [
"gtkd-2",
"gtkdgl-2",
"dl",
"DerelictGL3",
"DerelictUtil",
"DerelictFI",
"gl3n",
"glamour",
"curl",
],
"importPaths": [
"~/.dub/packages/gtk-d-master/src",
"~/.dub/packages/gtk-d-master/srcgl",
"~/.dub/packages/derelict-gl3-master/source",
"~/.dub/packages/derelict-fi-master/source",
"~/.dub/packages/derelict-util-1.0.0/source",
"~/.dub/packages/gl3n-master/",
"~/.dub/packages/glamour/",
],
"configurations": [
{
"name": "test",
"targetType": "executable",
"sourcePaths": ["test"],
}
]
}
So it's a hack, but it works for me - I have fast compilation at least.
I did the following - fetched packages I need, built every package using
dub and copied libs to /usr/local/lib - probably it's better to use path
to libs instead of copying.