mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.53k stars 1.61k forks source link

minsize buildtype #13504

Open EmixamPP opened 1 month ago

EmixamPP commented 1 month ago

I went through the different build types proposed by meson, and I see that buildtype=minsize sets debug=true and optimization=s. Wouldn't it make sense to set debug=false instead? Because debug=true adds symbols to the target and thus increases its size significantly.

Also, it would make sense to add strip=true when buildtype=minsize is set, to further reduce the size. (Personally, I would also enable it when buildtype=release)

On my project, I report the following sizes for my standalone executable:

As you can see, buildtype=minsize seems a bad name, since it is as big as buildtype=debug (without strip=true).

I can PR this change if you're interested.

A last question, I'm wondering why it is optimization=0 that has been chosen for buildtype=debug, and not optimization=g, although I guess debug=true enables that?

EmixamPP commented 1 month ago

In addition, meson setup|configure allows enabling --strip and --debug but there is no possibility to set them false, which limits the combinations of what we can set as default option and what can be modified/added manually.