Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
Hi!
I am trying to improve the current default optimization level baseline across C and C++ projects. I created this issue for Qt Creator, since it's one of the most popular open-source C++ IDEs nowadays.
Visual Studio enables LTO (/GL + /LTCG compiler switches) by default for their Release configurations (link). There are ongoing discussions in CMake about enabling LTO by default in this build system too but without huge progress. I didn't check other build systems though like Meson, Buck2, etc.
My idea is if build system maintainers cannot make such a decision, we can still try to make to the end-users a better "optimization experience by default" for their projects by tweaking this option in the project templates. If for some people, this setting doesn't suit them for various reasons, they will be able to easily opt out of it in their build scripts.
My suggestion is to enable LTO (which LTO kind - Fat or Thin - is up to a discussion) in the default C and C++ project templates for supported build systems like CMake, qmake, QBS for Release configurations. If this setting will be enabled in Qt Creator templates by default, more users will get more optimized Release binaries by default (similarly to the Visual Studio behavior).
Thank you.