Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized ios template for size larger than unoptimized #35789

Closed
Myran opened this issue Jan 31, 2020 · 3 comments
Closed

Optimized ios template for size larger than unoptimized #35789

Myran opened this issue Jan 31, 2020 · 3 comments
Labels

Comments

@Myran
Copy link

Myran commented Jan 31, 2020

Godot version:
11d28b2
OS/device including version:
MacOS 10.15.2
Issue description:
when optimizing for size for iOS as described in https://docs.godotengine.org/en/latest/development/compiling/optimizing_for_size.html the resulting file is larger than unoptimized.

scons p=iphone tools=no target=release arch=arm64 -j8
58101704  libgodot.iphone.opt.arm64.a 
scons p=iphone tools=no target=release arch=arm64 -j8 module_bmp_enabled=no module_bullet_enabled=no module_csg_enabled=no module_dds_enabled=no module_enet_enabled=no module_etc_enabled=no module_gdnative_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_mbedtls_enabled=no module_mobile_vr_enabled=no module_opus_enabled=no module_pvr_enabled=no module_recast_enabled=no module_regex_enabled=no module_squish_enabled=no module_tga_enabled=no module_thekla_unwrap_enabled=no module_theora_enabled=no module_tinyexr_enabled=no module_vorbis_enabled=no module_webm_enabled=no module_websocket_enabled=no disable_advanced_gui=yes disable_3d=yes optimize=size use_lto=yes
71307600 libgodot.iphone.opt.arm64.a

It seems the guide was based on an android test #18253, maybe there is additional steps for iOS?

@Calinou
Copy link
Member

Calinou commented Jan 31, 2020

LTO is known to give weird results on iOS. Try removing use_lto=yes from the optimized SCons command line.

@bruvzg
Copy link
Member

bruvzg commented Jan 31, 2020

iOS templates are static libraries, probably LTO saves some extra info for the optimization, actual optimization will happen when final executable is linked.

Compare size of executables exported and linked by Xcode instead.

@Myran
Copy link
Author

Myran commented Jan 31, 2020

iOS templates are static libraries, probably LTO saves some extra info for the optimization, actual optimization will happen when final executable is linked.

Compare size of executables exported and linked by Xcode instead

Thanks. when built, the ipa file decrease from 10 to 7,2 mb in size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants