1 From abc52460201bc5c7603505bb187138b0c59291aa Mon Sep 17 00:00:00 2001
2 From: Mushroom <mushroom@watchingyour.tv>
3 Date: Sun, 20 Dec 2020 00:11:41 +0000
4 Subject: [PATCH] [QtBase] Split macOS platforms by architecture
6 Currently macOS only has one platform, which forces the default arch to
7 x86_64. This patch splits the platforms by architecture, and defaults to
10 This stops M1-based macs from compiling x64 binaries by default,
11 instead making them compile native binaries.
13 [ChangeLog][QtBase][Platform Specific Changes][OS X] Split macOS
14 platforms so it doesn't default to the x64 architecture every time
16 Change-Id: I34891b107bb24f68371df1c8f087eb0ad5b5dd95
19 .../clang-macx-desktop.conf} | 8 ++--
20 mkspecs/common/macx.conf | 1 -
21 .../Info.plist.app | 0
22 .../Info.plist.dSYM.in | 0
23 .../Info.plist.disable_highdpi | 0
24 .../Info.plist.lib | 0
25 mkspecs/macx-clang-arm64/qmake.conf | 7 ++++
26 .../qplatformdefs.h | 0
27 mkspecs/macx-clang-x64/Info.plist.app | 24 +++++++++++
28 mkspecs/macx-clang-x64/Info.plist.dSYM.in | 18 ++++++++
29 .../macx-clang-x64/Info.plist.disable_highdpi | 8 ++++
30 mkspecs/macx-clang-x64/Info.plist.lib | 20 +++++++++
31 mkspecs/macx-clang-x64/qmake.conf | 7 ++++
32 mkspecs/macx-clang-x64/qplatformdefs.h | 41 +++++++++++++++++++
33 15 files changed, 137 insertions(+), 6 deletions(-)
34 rename mkspecs/{macx-clang/qmake.conf => common/clang-macx-desktop.conf} (83%)
35 rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.app (100%)
36 rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.dSYM.in (100%)
37 rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.disable_highdpi (100%)
38 rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.lib (100%)
39 create mode 100644 mkspecs/macx-clang-arm64/qmake.conf
40 rename mkspecs/{macx-clang => macx-clang-arm64}/qplatformdefs.h (100%)
41 create mode 100644 mkspecs/macx-clang-x64/Info.plist.app
42 create mode 100644 mkspecs/macx-clang-x64/Info.plist.dSYM.in
43 create mode 100644 mkspecs/macx-clang-x64/Info.plist.disable_highdpi
44 create mode 100644 mkspecs/macx-clang-x64/Info.plist.lib
45 create mode 100644 mkspecs/macx-clang-x64/qmake.conf
46 create mode 100644 mkspecs/macx-clang-x64/qplatformdefs.h
48 diff --git a/configure b/configure
49 index b6c9b462f24..a86f2ceaa5b 100755
52 @@ -556,7 +556,14 @@ PLATFORM_NOTES=
53 if [ -z "$PLATFORM" ]; then
54 case "$UNAME_SYSTEM:$UNAME_RELEASE" in
57 + case "$UNAME_MACHINE" in
59 + PLATFORM=macx-clang-arm64
62 + PLATFORM=macx-clang-x64
68 diff --git a/mkspecs/macx-clang/qmake.conf b/mkspecs/common/clang-macx-desktop.conf
70 rename from mkspecs/macx-clang/qmake.conf
71 rename to mkspecs/common/clang-macx-desktop.conf
72 index 0cf1f31b60d..042319a2aa3 100644
73 --- a/mkspecs/macx-clang/qmake.conf
74 +++ b/mkspecs/common/clang-macx-desktop.conf
75 @@ -24,9 +24,9 @@ QMAKE_LIBS_X11 = -lX11 -lXext -lm
76 QMAKE_LIBDIR_X11 = /opt/X11/lib
77 QMAKE_INCDIR_X11 = /opt/X11/include
79 -include(../common/macx.conf)
80 -include(../common/gcc-base-mac.conf)
81 -include(../common/clang.conf)
82 -include(../common/clang-mac.conf)
84 +include(gcc-base-mac.conf)
86 +include(clang-mac.conf)
89 diff --git a/mkspecs/macx-clang/Info.plist.app b/mkspecs/macx-clang-arm64/Info.plist.app
91 rename from mkspecs/macx-clang/Info.plist.app
92 rename to mkspecs/macx-clang-arm64/Info.plist.app
93 diff --git a/mkspecs/macx-clang/Info.plist.dSYM.in b/mkspecs/macx-clang-arm64/Info.plist.dSYM.in
95 rename from mkspecs/macx-clang/Info.plist.dSYM.in
96 rename to mkspecs/macx-clang-arm64/Info.plist.dSYM.in
97 diff --git a/mkspecs/macx-clang/Info.plist.disable_highdpi b/mkspecs/macx-clang-arm64/Info.plist.disable_highdpi
99 rename from mkspecs/macx-clang/Info.plist.disable_highdpi
100 rename to mkspecs/macx-clang-arm64/Info.plist.disable_highdpi
101 diff --git a/mkspecs/macx-clang/Info.plist.lib b/mkspecs/macx-clang-arm64/Info.plist.lib
102 similarity index 100%
103 rename from mkspecs/macx-clang/Info.plist.lib
104 rename to mkspecs/macx-clang-arm64/Info.plist.lib
105 diff --git a/mkspecs/macx-clang-arm64/qmake.conf b/mkspecs/macx-clang-arm64/qmake.conf
107 index 00000000000..0cc2361e696
109 +++ b/mkspecs/macx-clang-arm64/qmake.conf
112 +# qmake configuration for Clang on OS X (arm64)
115 +QMAKE_APPLE_DEVICE_ARCHS=arm64
117 +include(../common/clang-macx-desktop.conf)
118 diff --git a/mkspecs/macx-clang/qplatformdefs.h b/mkspecs/macx-clang-arm64/qplatformdefs.h
119 similarity index 100%
120 rename from mkspecs/macx-clang/qplatformdefs.h
121 rename to mkspecs/macx-clang-arm64/qplatformdefs.h
122 diff --git a/mkspecs/macx-clang-x64/Info.plist.app b/mkspecs/macx-clang-x64/Info.plist.app
124 index 00000000000..fa592af0897
126 +++ b/mkspecs/macx-clang-x64/Info.plist.app
128 +<?xml version="1.0" encoding="UTF-8"?>
129 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
130 +<plist version="1.0">
132 + <key>CFBundleExecutable</key>
133 + <string>${EXECUTABLE_NAME}</string>
134 + <key>CFBundleIconFile</key>
135 + <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
136 + <key>CFBundleIdentifier</key>
137 + <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
138 + <key>CFBundlePackageType</key>
139 + <string>APPL</string>
140 + <key>CFBundleSignature</key>
141 + <string>${QMAKE_PKGINFO_TYPEINFO}</string>
142 + <key>LSMinimumSystemVersion</key>
143 + <string>${MACOSX_DEPLOYMENT_TARGET}</string>
145 + <string>This file was generated by Qt/QMake.</string>
146 + <key>NSPrincipalClass</key>
147 + <string>NSApplication</string>
148 + <key>NSSupportsAutomaticGraphicsSwitching</key>
152 diff --git a/mkspecs/macx-clang-x64/Info.plist.dSYM.in b/mkspecs/macx-clang-x64/Info.plist.dSYM.in
154 index 00000000000..a8c8d0d4fb5
156 +++ b/mkspecs/macx-clang-x64/Info.plist.dSYM.in
158 +<?xml version=\"1.0\" encoding=\"UTF-8\"?>
159 +<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
160 +<plist version=\"1.0\">
162 + <key>CFBundleIdentifier</key>
163 + <string>com.apple.xcode.dsym.$${BUNDLEIDENTIFIER}</string>
164 + <key>CFBundlePackageType</key>
165 + <string>dSYM</string>
166 + <key>CFBundleSignature</key>
167 + <string>????</string>
168 +!!IF !isEmpty(VERSION)
169 + <key>CFBundleShortVersionString</key>
170 + <string>$${VER_MAJ}.$${VER_MIN}</string>
171 + <key>CFBundleVersion</key>
172 + <string>$${VER_MAJ}.$${VER_MIN}.$${VER_PAT}</string>
176 diff --git a/mkspecs/macx-clang-x64/Info.plist.disable_highdpi b/mkspecs/macx-clang-x64/Info.plist.disable_highdpi
178 index 00000000000..a9b89888ad4
180 +++ b/mkspecs/macx-clang-x64/Info.plist.disable_highdpi
182 +<?xml version="1.0" encoding="UTF-8"?>
183 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
184 +<plist version="1.0">
186 + <key>NSHighResolutionCapable</key>
187 + <string>NO</string>
190 diff --git a/mkspecs/macx-clang-x64/Info.plist.lib b/mkspecs/macx-clang-x64/Info.plist.lib
192 index 00000000000..34752ec40d9
194 +++ b/mkspecs/macx-clang-x64/Info.plist.lib
196 +<?xml version="1.0" encoding="UTF-8"?>
197 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
198 +<plist version="1.0">
200 + <key>CFBundleExecutable</key>
201 + <string>${EXECUTABLE_NAME}</string>
202 + <key>CFBundleIdentifier</key>
203 + <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
204 + <key>CFBundlePackageType</key>
205 + <string>FMWK</string>
206 + <key>CFBundleShortVersionString</key>
207 + <string>${QMAKE_SHORT_VERSION}</string>
208 + <key>CFBundleSignature</key>
209 + <string>${QMAKE_PKGINFO_TYPEINFO}</string>
210 + <key>CFBundleVersion</key>
211 + <string>${QMAKE_FULL_VERSION}</string>
213 + <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
216 diff --git a/mkspecs/macx-clang-x64/qmake.conf b/mkspecs/macx-clang-x64/qmake.conf
218 index 00000000000..1ac373b53b4
220 +++ b/mkspecs/macx-clang-x64/qmake.conf
223 +# qmake configuration for Clang on OS X (arm64)
226 +QMAKE_APPLE_DEVICE_ARCHS=x86_64
228 +include(../common/clang-macx-desktop.conf)
229 diff --git a/mkspecs/macx-clang-x64/qplatformdefs.h b/mkspecs/macx-clang-x64/qplatformdefs.h
231 index 00000000000..063491dd900
233 +++ b/mkspecs/macx-clang-x64/qplatformdefs.h
235 +/****************************************************************************
237 +** Copyright (C) 2016 The Qt Company Ltd.
238 +** Contact: https://www.qt.io/licensing/
240 +** This file is part of the qmake spec of the Qt Toolkit.
242 +** $QT_BEGIN_LICENSE:LGPL$
243 +** Commercial License Usage
244 +** Licensees holding valid commercial Qt licenses may use this file in
245 +** accordance with the commercial license agreement provided with the
246 +** Software or, alternatively, in accordance with the terms contained in
247 +** a written agreement between you and The Qt Company. For licensing terms
248 +** and conditions see https://www.qt.io/terms-conditions. For further
249 +** information use the contact form at https://www.qt.io/contact-us.
251 +** GNU Lesser General Public License Usage
252 +** Alternatively, this file may be used under the terms of the GNU Lesser
253 +** General Public License version 3 as published by the Free Software
254 +** Foundation and appearing in the file LICENSE.LGPL3 included in the
255 +** packaging of this file. Please review the following information to
256 +** ensure the GNU Lesser General Public License version 3 requirements
257 +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
259 +** GNU General Public License Usage
260 +** Alternatively, this file may be used under the terms of the GNU
261 +** General Public License version 2.0 or (at your option) the GNU General
262 +** Public license version 3 or any later version approved by the KDE Free
263 +** Qt Foundation. The licenses are as published by the Free Software
264 +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
265 +** included in the packaging of this file. Please review the following
266 +** information to ensure the GNU General Public License requirements will
267 +** be met: https://www.gnu.org/licenses/gpl-2.0.html and
268 +** https://www.gnu.org/licenses/gpl-3.0.html.
272 +****************************************************************************/
274 +#include "../common/mac/qplatformdefs.h"