www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Dub and what it does

reply Russel Winder <russel winder.org.uk> writes:
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?

--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
Dr Russel Winder       Director
It'z Interactive Ltd   t: +44 20 7585 2200        voip: sip:russel.winder e=
kiga.net
41 Buckmaster Road     m: +44 7770 465 077        xmpp: russel winder.org.u=
k
London SW11 1EN, UK    w: www.itzinteractive.com  skype: russel_winder
Dec 23 2013
next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2013-12-23 09:04, Russel Winder wrote:
 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?
You need to add a package.json file to your project. http://code.dlang.org/package-format -- /Jacob Carlborg
Dec 23 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-12-23 10:52, Jacob Carlborg wrote:

 You need to add a package.json file to your project.

 http://code.dlang.org/package-format
I accidentally sent the above message too soon. You either need to explicitly set the target type[1] to "executable" or make sure your project works with "autodetect". Add the GtkD package as a dependency[2]. [1] http://code.dlang.org/package-format#target-types [2] http://code.dlang.org/package-format#build-settings -- /Jacob Carlborg
Dec 23 2013
parent Russel Winder <russel winder.org.uk> writes:
On Mon, 2013-12-23 at 10:57 +0100, Jacob Carlborg wrote:
 On 2013-12-23 10:52, Jacob Carlborg wrote:
 
 You need to add a package.json file to your project.

 http://code.dlang.org/package-format
I accidentally sent the above message too soon.
I was worried by that previous post as I think it impossible to have a Dub build without a package.json ;-)
 You either need to explicitly set the target type[1] to "executable" or 
 make sure your project works with "autodetect". Add the GtkD package as 
 a dependency[2].
 
 [1] http://code.dlang.org/package-format#target-types
 [2] http://code.dlang.org/package-format#build-settings
It seems that a project with no target type but just a dependency on GtkD generates static library rather than executable. I'll use an explicit setting to avoid autodetect. Thanks. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Dec 23 2013
prev sibling parent Alexandr Druzhinin <drug2004 bk.ru> writes:
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.
Dec 23 2013