Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-109394

Support cmake UNITY_BUILD

    XMLWordPrintable

Details

    • Epic
    • Resolution: Fixed
    • P3: Somewhat important
    • None
    • None
    • Build System: CMake
    • None
    • UNITY_BUILD
    • All
    • aa29b3ef5 (dev), d9d74723c (dev), c1e390f16 (dev), da36ac3c3 (6.5), d3596c07e (6.4), 9676e0de6 (6.5), 013a05a93 (6.5), 135a79294 (dev), bd99d0212 (6.4), 60816bcd3 (dev), b2789fd47 (6.5), c925d1b4a (dev), 356bed88f (tqtc/lts-6.2), f1fe08e07 (6.5)

    Description

      qt is a huge project and takes time to build

      it could be great to support cmake unity/jumbo build and reduce build time:

      https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html

      I tried passing "cmake -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=16"

      typical errors are static variables cloberring and ambiguous namespaces:

       

       
      qtbase/src/corelib/serialization/qcborstreamwriter.cpp:553:22: error: 'cbor_encode_float' was not declared in this scope; did you mean 'cbor_encode_uint'?
       2022-12-13T15:35:22.2822474Z 553 | d->executeAppend(cbor_encode_float, f);
       2022-12-13T15:35:22.2823065Z | ^~~~~~~~~~~~~~~~~
      ...
      qtbase/src/corelib/text/qstring.cpp:6945:29: error: call of overloaded 'qIsUpper(const char&)' is ambiguous
       2022-12-13T15:35:23.0507306Z 6945 | if (qIsUpper(*c))
       2022-12-13T15:35:23.0507774Z | ~~~~~~~^~~
       2022-12-13T15:35:23.0508296Z In file included from $SRC_DIR/build/qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/Unity/unity_3_cxx.cxx:7:
       2022-12-13T15:35:23.0509061Z $SRC_DIR/qtbase/src/corelib/text/qlocale.cpp:2601:13: note: candidate: 'bool qIsUpper(char)'
      

       Known issues

      • X11 headers containing things like #define None 0 causing clashes
      • Some Windows headers (network?) not guarded
      • Metatype declarations causing issues. Could be fixed by removing them (see https://lists.qt-project.org/pipermail/development/2022-July/042744.html )
      • -Werror=subobject-linkage producing qerrormessage.cpp:38:7: error: ‘QErrorMessagePrivate’ has a field ‘QErrorMessagePrivate::pending’ whose type uses the anonymous namespace []

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              jschueller Julien Schueller
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are 16 open Gerrit changes