How to reduce the final build size of a cocos2dx project?

FWIW I’ve found you need to set the COCOS_xxx preprocessor symbols for best results (smallest code size) and not just rely on dead code stripping in the build.

For my build I’m setting the following to 0:
CC_ENABLE_SCRIPT_BINDING
CC_USE_JPEG
CC_USE_TIFF
CC_USE_WEBP
CC_USE_PHYSICS
CC_USE_3D_PHYSICS
CC_ENABLE_BULLET_INTEGRATION
CC_ENABLE_CHIPMUNK_INTEGRATION
CC_USE_NAVMESH

With these settings an “empty” project that just opens a black screen has a 600k arm7+arm64 fat executable on iOS.

4 Likes