Skip to content

Commit

Permalink
Fix the deployment target problem once and for all
Browse files Browse the repository at this point in the history
Instead of hardcoding the value of LSMinimumSystemVersion in Info.plist
where we will always forget to update it (and since Qt Creator can be
built with multiple versions of Qt, it will almost certainly be wrong
for one of those versions), automatically determine the value from
QMAKE_MACOSX_DEPLOYMENT_TARGET, which is authoritative.

This should prevent mishaps where users try to run Qt Creator on older
OS versions and receive a crash dialog instead of the friendly "This
app requires a newer version of macOS" message that a properly set
LSMinimumSystemVersion value will induce.

The Qbs build is not affected by this problem, as Qbs automatically
handles the minimum deployment target even when a custom Info.plist is
specified.

The solution chosen in this patch was used instead of QMAKE_SUBSTITUTES
because the Qbs build also uses the Info.plist input file and it would
break the Qbs build if the quotes were to be escaped, since it would
become invalid XML.

Change-Id: I20625a2fae546c6597a567f28864b12917e8ac39
Reviewed-by: Oswald Buddenhagen <[email protected]>
  • Loading branch information
jakepetroules committed Jul 7, 2017
1 parent b80d5c1 commit 4196534
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,6 @@
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<key>LSMinimumSystemVersion</key>
<string>10.8</string>
<string>@MACOSX_DEPLOYMENT_TARGET@</string>
</dict>
</plist>
7 changes: 6 additions & 1 deletion src/app/app.pro
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ win32 {
INSTALLS += icns
}
}
QMAKE_INFO_PLIST = Info.plist

infoplist = $$cat($$PWD/Info.plist, blob)
infoplist = $$replace(infoplist, @MACOSX_DEPLOYMENT_TARGET@, $$QMAKE_MACOSX_DEPLOYMENT_TARGET)
write_file($$OUT_PWD/Info.plist, infoplist)

QMAKE_INFO_PLIST = $$OUT_PWD/Info.plist
}

target.path = $$INSTALL_APP_PATH
Expand Down

0 comments on commit 4196534

Please sign in to comment.