Sergey
Sergey

Reputation: 11

Qt 5.12 for iOS: build system

Accordingly to https://bugreports.qt.io/browse/QTBUG-94562 and https://codereview.qt-project.org/c/qt/qtbase/+/353189 I expect Qt (qmake) version 5.12.11 will produce 'Xcode 12.0-compatible' or 'modern' xCode project. Unfortunately, I see project format is still 'xCode 3.2-compatible'. Where am I wrong? Is some additional setup required?

xCode 13 drops support of Legacy build system, so I am in a big trouble.

Upvotes: 1

Views: 969

Answers (1)

cycollins
cycollins

Reputation: 465

So I encountered this problem in Qt 5.15.5, building with Xcode 13, just as you predicted. I found this https://codereview.qt-project.org/c/qt/qtbase/+/353118. The Xcode 13 told me that it wasn't going to put up with the old build system any more - the one that was used prior to Xcode 10, I think. The reason it was defaulting to that old system was exactly what you were observing - qmake always makes projects that use the legacy build system. The qmake mkspec called macx-xcode (stored at /qtbase/mkspecs/macx-xcode which is a folder containing some .mk files and related other files) controls how qmake generates an Xcode project. It does so partly by containing some templates for projects and workspaces that it will use to dynamically flesh out a full project. One of those is called WorkspaceSettings.xcsettings (within the macx-xcode folder). It's just a place-holder to be filled with workspace-level settings that apply to all projects sharing it. It's written in the same XML that comprises all Xcode project files. It has almost nothing in it EXCEPT two lines that are screwing things up for both of us (the ones that the patch for the bug I linked removes). In your version of Qt right up until 5.15.5, it looks like this -

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>BuildSystemType</key>
    <string>Original</string>
    <key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
    <false/>
</dict>
</plist>

The fix is to remove the first key-value pair, because it's saying specifically use the "Original" build system which predates Xcode 10. Just remove the two lines after <dict> and things should be better. For me it fixed things right up. In Qt 5.15.6, this change has been incorporated, so it's one of the bugs that fixed for that dot-release, but it should cause no harm to fix up your local version. If you don't build Qt from source (which I do, along with a handful of other mods), you could look at going to 5.15.6 directly. In my case, I just made the change in addition others I've made and I check it into my mirror repository. But again, it will cause no harm to doctor your local copy of Qt with this fix. It just get's tricky as a maintenance issue if you're coordinating with a big team.

Upvotes: 2

Related Questions