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

moc for iOS picks up wrong includes when following a desktop build

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.9.2, 5.12.2
    • None
    • iOS/tvOS/watchOS, macOS

    Description

      Attached is an example project with this issue.

      Overview

      This issue does not affect Android when tested.

      Running a macOS build, followed by a clean, then as iOS build, will include the wrong XCode platform directories in the moc stage. (This is also the case the other way around.) This example requires the shadow build to be turned off if building from Qt Creator. 

      Under macOS we expect to see this include in the moc stage compile output:

      • -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include

      Under iOS we expect to see this include in the moc stage compile output:

      • -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/usr/include

      But this is not the case. Doing one build followed by a clean, then the opposing build, will always include the Platforms include directory of the previous build.

      This can break builds, as certain defines will now exist in the moc stage that do not exist in the compile stage. The provided example project works fine when built clean on any platform. But will fail if macOS/iOS is built on one platform followed by the other.

      Repro steps

      1. Unzip the example project.
      2. Open in Qt Creator.
      3. Setup the Desktop MacOS kit with shadow build disabled.
      4. Build the project.
      5. Observe that the build has completed correctly, note that the compile output for the moc contains the following include:
        -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include
      6. Setup the iOS kit with shadow build disabled.
      7. Clean the project.
      8. Build the project
      9. Observe the build has failed. Observe that the compile output moc does not contain the following include (but does instead contains the desktop include):
        -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/usr/include
      10. Observe that repeating the above steps with Android works as expected.

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            nmacdonald Neil MacDonald
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes