Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt6 cross compile experience

Qt6 cross compile experience

Scheduled Pinned Locked Moved Unsolved Qt 6
7 Posts 7 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Nguyen
    wrote on last edited by
    #1

    I can not find anything that guides to cross-compile Qt6 for embedded devices except for the laments to complain.

    Now cross-compiling Qt6 for any platform is broken and painful:

    • first and foremost, we need to waste time to fully build and install it
      for host platform (desktop). Yeah, I know that this was "decided" before TQC
      switched, overnight, to cmake, but let's face it, it's a BS needed to cover
      the fact that cmake can't build more than one platform at once.

    • the cross build installation is broken, instead to copy the tools from the
      QT_HOST_TOOLS folder, it creates some scripts that has hardcoded paths to
      QT_HOST_TOOLS which runs the scripts from QT_HOST_TOOLS folder. Of course this
      makes the installation unusable on another computer. Even the "lib/cmake/Qt6/
      qt.toolchain.cmake" contains hardcoded paths...

    • there is no way to have a standalone cross build installation, we always
      need to ship the whole desktop installation as well (also patch all the files
      from cross installation).

    • android cross compilation is so crippled now. In Qt 5.x times, we used to
      have a nice multi ABI build which built all the android ABIs in one go and it
      created a unified Qt SDK for all these ABIs (same as the Android NDK). In Qt 6,
      that work was trashed... for the same reason: cmake can't handle multiple
      platforms at once...

    • android cross compilation in Qt 6 takes more time to build one ABI with
      less Qt modules than in Qt5 to build all ABIs and all modules...

    • IMHO the qmake build files were removed prematurely ... they should be
      removed after cmake matched qmake.

    Having said that, I truly believe that cmake is a big step backwards.
    Am I the only one who's bother by all these things?

    We have a huge elephant in the room which nobody want to see it...

    Source: https://lists.qt-project.org/pipermail/development/2021-February/041042.html

    Jonas KvingeJ 1 Reply Last reply
    3
    • K Kevin Nguyen

      I can not find anything that guides to cross-compile Qt6 for embedded devices except for the laments to complain.

      Now cross-compiling Qt6 for any platform is broken and painful:

      • first and foremost, we need to waste time to fully build and install it
        for host platform (desktop). Yeah, I know that this was "decided" before TQC
        switched, overnight, to cmake, but let's face it, it's a BS needed to cover
        the fact that cmake can't build more than one platform at once.

      • the cross build installation is broken, instead to copy the tools from the
        QT_HOST_TOOLS folder, it creates some scripts that has hardcoded paths to
        QT_HOST_TOOLS which runs the scripts from QT_HOST_TOOLS folder. Of course this
        makes the installation unusable on another computer. Even the "lib/cmake/Qt6/
        qt.toolchain.cmake" contains hardcoded paths...

      • there is no way to have a standalone cross build installation, we always
        need to ship the whole desktop installation as well (also patch all the files
        from cross installation).

      • android cross compilation is so crippled now. In Qt 5.x times, we used to
        have a nice multi ABI build which built all the android ABIs in one go and it
        created a unified Qt SDK for all these ABIs (same as the Android NDK). In Qt 6,
        that work was trashed... for the same reason: cmake can't handle multiple
        platforms at once...

      • android cross compilation in Qt 6 takes more time to build one ABI with
        less Qt modules than in Qt5 to build all ABIs and all modules...

      • IMHO the qmake build files were removed prematurely ... they should be
        removed after cmake matched qmake.

      Having said that, I truly believe that cmake is a big step backwards.
      Am I the only one who's bother by all these things?

      We have a huge elephant in the room which nobody want to see it...

      Source: https://lists.qt-project.org/pipermail/development/2021-February/041042.html

      Jonas KvingeJ Offline
      Jonas KvingeJ Offline
      Jonas Kvinge
      wrote on last edited by
      #2

      @Kevin-Nguyen
      I don't know about android, but I'm cross-compiling Qt 6 for Windows, perhaps my cmake steps can help you:
      https://github.com/strawberrymusicplayer/strawberry-mxe/blob/master/src/qt6-qtbase.mk
      https://github.com/strawberrymusicplayer/strawberry-mxe/blob/master/src/qt6-qttools.mk

      W 1 Reply Last reply
      0
      • Jonas KvingeJ Jonas Kvinge

        @Kevin-Nguyen
        I don't know about android, but I'm cross-compiling Qt 6 for Windows, perhaps my cmake steps can help you:
        https://github.com/strawberrymusicplayer/strawberry-mxe/blob/master/src/qt6-qtbase.mk
        https://github.com/strawberrymusicplayer/strawberry-mxe/blob/master/src/qt6-qttools.mk

        W Offline
        W Offline
        warpme
        wrote on last edited by
        #3

        @Jonas-Kvinge

        Hi Jonas

        I trying to cross-compile Qt6.
        I looked on Your work and - and basing on it - i added Qt6 to my project (MiniMyth2).

        Unfortunately i'm getting https://forum.qt.io/topic/130366/cross-compiling-qt6-moc-cannot-execute-binary-file

        Maybe You have some hints for me?

        1 Reply Last reply
        0
        • O Offline
          O Offline
          Orocle
          wrote on last edited by
          #4

          I agree with everything said here. Compiling QT6 is overly complicated, and what the heck was wrong with the QT5 method that needed to be changed? QT5 was hard enough to cross-compile now you got several new layers of silliness.

          FIX IT!

          Christian EhrlicherC 1 Reply Last reply
          1
          • O Orocle

            I agree with everything said here. Compiling QT6 is overly complicated, and what the heck was wrong with the QT5 method that needed to be changed? QT5 was hard enough to cross-compile now you got several new layers of silliness.

            FIX IT!

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Orocle said in Qt6 cross compile experience:

            FIX IT!

            Feel free to provide patches to simplify the process

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            SupervisedThinkingS 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @Orocle said in Qt6 cross compile experience:

              FIX IT!

              Feel free to provide patches to simplify the process

              SupervisedThinkingS Offline
              SupervisedThinkingS Offline
              SupervisedThinking
              wrote on last edited by
              #6

              @Christian-Ehrlicher well the current problem is obvious. Instead of building the the build tools in step 1 & cross compile Qt in step 2 we now have to build a complete Qt package on the build machine before we can cross compile it. We also have to satisfy all dependencies which we otherwise would use on the build system.

              I don't get why someone thought it's a smart move to do it this way, why can't we just compile the necessary tools and then straight complie Qt for the target system, well the same way Qt5 used to compile.

              1 Reply Last reply
              0
              • kkoehneK Offline
                kkoehneK Offline
                kkoehne
                Moderators
                wrote on last edited by
                #7

                I don't get why someone thought it's a smart move to do it this way

                One advantage is that there's a clear separation between both builds in the configure system. In the Qt 5 one, some options applied to the host tools, some to the target tools and binaries, and some to both.

                Director R&D, The Qt Company

                1 Reply Last reply
                1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved