Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-32330

Enable Link-Time Optimization (LTO) in C and C++ project templates

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • All Other Issues
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            con Eike Ziller
            zamazan4ik Alexander Zaitsev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes