[Qt-interest] Mac OS X Bundle Sizes
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Sun Apr 19 12:48:33 CEST 2009
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-
> bounces at trolltech.com] On Behalf Of Freddie Witherden
> Sent: Sunday, April 19, 2009 3:21 AM
> To: qt-interest at trolltech.com
> Subject: [Qt-interest] Mac OS X Bundle Sizes
>
> Hi,
>
> I use the macdeployqt tool in order to package my application for OS
X.
> However, while the application itself is only 200 KiB or so the bundle
weighs
> in at over 30 MiB for a universal binary. By comparison the
statically-linked
> Windows build of my application comes in at just
> 6.6 MiB.
>
> While I am aware that static linking does allow the linker to remove
unused
> code and that a universal build needs two copies (one for PPC and one
for
> Intel) of each framework is there any way that I can reduce the
resulting
> bundle size?
>
> (I am unsure if it is possible to strip unused symbols from Frameworks
in much
> the same way that the linker would when statically linking.)
>
> Regards, Freddie.
Not really.. When you ship dynamic/shared libs for only 1 application,
or not actually sharing them across applications, you are simply wasting
hard drive space.. Not that this "waste" isn't useful for other reasons
(allowing plugins for QT is one major advantaged) but if you are only
using 1/2 a library, you are shipping the other half, just in case some
other app needs it...
One way to do what you want, is to build a minimal build of QT itself...
Which is the technique I have used for embedded QT.. Where I may have 2
or 3 QT apps on my device, so I want a share library.. However I am not
using anywhere near the full QT library.
You can do this, but going through and manually removing what is used
via #defines..
Ie, not using QT3 support, make sure its defined out, same thing for say
comboboxes.. TrolLTech is VERY VERY good about allowing you to remove a
bunch of functionality that you don't need...
Scott
More information about the Qt-interest-old
mailing list