Reduzca el tamaño de wxWidgets Mac y deshabilite PNG

I edited the port file to create wxWidgets statically because I wanted to reduce the executable size. At first I used dynamic linking and dylibbundler, but that resulted in ~40 MB size for the Bundle. Using statically linked wxWidgets and a bunch of strip settings, I can get the executable to ~10 MB and the bundle to 11 MB. However, I know for a fact that the simple program is still using libpng.a because when I remove the library in the link options, I get link errors. I tried specifying wxNO_PNG_LIB in the prefix header, before any includes, all over the place until Xcode started complaining about redefinitions. For such a simple application, I'd like to be able to have a smaller application size, and I think removing PNG and perhaps some other strip commands is all that I have left.

However, if anyone knows better ways to reduce wxWidgets size, I'm using macports GCC 4.9 with Xcode and statically compiled wxwidgets30 from port.

preguntado el 15 de mayo de 13 a las 04:05

1 Respuestas

Definición wxNO_PNG_LIB won't help under Mac, it's MSVC-specific. You need to build your own version of wxWidgets without PNG support (although this is really the last thing I'd want to disable) and everything else you can get away with. Basically start by running configure --disable-all-features and then add enable options for everything you do need.

contestado el 15 de mayo de 13 a las 12:05

Ah, perhaps I can add my own variant to the wxwidgets30 port file which is a barebones version. That's the great thing about macports, I can switch between the variants. Thanks for the suggestion. - norcalli

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.