Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.9.2, 5.12.2
-
None
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
- Unzip the example project.
- Open in Qt Creator.
- Setup the Desktop MacOS kit with shadow build disabled.
- Build the project.
- 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 - Setup the iOS kit with shadow build disabled.
- Clean the project.
- Build the project
- 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 - Observe that repeating the above steps with Android works as expected.