Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Inconsistent builds with Subdirs Project and switching devices
Qt 6.11 is out! See what's new in the release blog

Inconsistent builds with Subdirs Project and switching devices

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.6k Views 1 Watching
  • 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
    kloveridge
    wrote on last edited by
    #1

    I have a project that is to be compiled as a Desktop or a Ios application. My subdirs project contains this:

    @cache()

    TEMPLATE = subdirs

    CONFIG += ordered

    SUBDIRS = ../Underworld ../EngineOGL ../Ankh@

    When I switch between devices and hit "rebuild", I am seeing the build files "get stuck" on the previous device. For example, if I compile as Ios for a while, everything seems to be fine. But when I switch to Desktop, I sometimes catch the compiler not building the desktop libraries, but continuing to build the Ios version. After several rebuilds, cleans and waving a dead chicken over my computer, my application will eventually build the right version.

    Does anyone have any idea why simply rebuilding isn't working consistently?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Clean project

      Run qmake

      Rebuild

      That should work reliably. The problem (most probably) is in outdated Makefiles, and to update them you need to run qmake.

      (Z(:^

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Just a wild guess, does it also happen if you remove the cache() line ?

        There's also something a bit surprising in your setup, subdirs project generally have their subdirs in the same folder as the pro file which defines the subdirs template.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kloveridge
          wrote on last edited by
          #4

          Sierdzio,
          It appears your solution works so far. Makes sense what was going on now.
          Thanks for your help!

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            Another way might be to use shadow building option from Qt Creator (that may save a lot of time during project building), but I'm not sure as I don't use it.

            The general idea behind shadow builds is that all Kit setups get a separate build directory, and so when switching between Kits you do not need to recompile everything.

            (Z(:^

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              sierdzio has a good point about shadow building, especially when you're cross-compiling (or using several different versions of Qt)

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

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