commit abc52460201bc5c7603505bb187138b0c59291aa Author: Mushroom Date: Sun Dec 20 00:11:41 2020 +0000 [QtBase] Split macOS platforms by architecture Currently macOS only has one platform, which forces the default arch to x86_64. This patch splits the platforms by architecture, and defaults to the same as the host. This stops M1-based macs from compiling x64 binaries by default, instead making them compile native binaries. [ChangeLog][QtBase][Platform Specific Changes][OS X] Split macOS platforms so it doesn't default to the x64 architecture every time Change-Id: I34891b107bb24f68371df1c8f087eb0ad5b5dd95 diff --git a/configure b/configure index b6c9b462f2..a86f2ceaa5 100755 --- a/configure +++ b/configure @@ -556,7 +556,14 @@ PLATFORM_NOTES= if [ -z "$PLATFORM" ]; then case "$UNAME_SYSTEM:$UNAME_RELEASE" in Darwin:*) - PLATFORM=macx-clang + case "$UNAME_MACHINE" in + arm64) + PLATFORM=macx-clang-arm64 + ;; + *) + PLATFORM=macx-clang-x64 + ;; + esac ;; AIX:*) #PLATFORM=aix-g++ diff --git a/mkspecs/common/clang-macx-desktop.conf b/mkspecs/common/clang-macx-desktop.conf new file mode 100644 index 0000000000..042319a2aa --- /dev/null +++ b/mkspecs/common/clang-macx-desktop.conf @@ -0,0 +1,32 @@ +# +# qmake configuration for Clang on OS X +# + +# Opt-in xcb QPA support with XQuartz: +# +# configure \ +# -pkg-config \ +# -fontconfig -system-freetype \ +# -xcb -no-opengl +# +# Ensure that pkg-config is properly configured, or that +# PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig +# is set in your build environment. +# +# If you don't want to use pkg-config, you can add: +# -L/opt/X11/lib -I/opt/X11/include +# to the configure options. +# +# Due to irreconcilable differences between Cocoa +# and X11, OpenGL is currently not supported. + +QMAKE_LIBS_X11 = -lX11 -lXext -lm +QMAKE_LIBDIR_X11 = /opt/X11/lib +QMAKE_INCDIR_X11 = /opt/X11/include + +include(macx.conf) +include(gcc-base-mac.conf) +include(clang.conf) +include(clang-mac.conf) + +load(qt_config) diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf index d16b77acb8..4ba0a8eaa3 100644 --- a/mkspecs/common/macx.conf +++ b/mkspecs/common/macx.conf @@ -6,7 +6,6 @@ QMAKE_PLATFORM += macos osx macx QMAKE_MAC_SDK = macosx QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13 -QMAKE_APPLE_DEVICE_ARCHS = x86_64 # Should be 10.15, but as long as the CI builds with # older SDKs we have to keep this. diff --git a/mkspecs/macx-clang-arm64/Info.plist.app b/mkspecs/macx-clang-arm64/Info.plist.app new file mode 100644 index 0000000000..fa592af089 --- /dev/null +++ b/mkspecs/macx-clang-arm64/Info.plist.app @@ -0,0 +1,24 @@ + + + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + ${ASSETCATALOG_COMPILER_APPICON_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundlePackageType + APPL + CFBundleSignature + ${QMAKE_PKGINFO_TYPEINFO} + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NOTE + This file was generated by Qt/QMake. + NSPrincipalClass + NSApplication + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/mkspecs/macx-clang-arm64/Info.plist.dSYM.in b/mkspecs/macx-clang-arm64/Info.plist.dSYM.in new file mode 100644 index 0000000000..a8c8d0d4fb --- /dev/null +++ b/mkspecs/macx-clang-arm64/Info.plist.dSYM.in @@ -0,0 +1,18 @@ + + + + + CFBundleIdentifier + com.apple.xcode.dsym.$${BUNDLEIDENTIFIER} + CFBundlePackageType + dSYM + CFBundleSignature + ???? +!!IF !isEmpty(VERSION) + CFBundleShortVersionString + $${VER_MAJ}.$${VER_MIN} + CFBundleVersion + $${VER_MAJ}.$${VER_MIN}.$${VER_PAT} +!!ENDIF + + diff --git a/mkspecs/macx-clang-arm64/Info.plist.disable_highdpi b/mkspecs/macx-clang-arm64/Info.plist.disable_highdpi new file mode 100644 index 0000000000..a9b89888ad --- /dev/null +++ b/mkspecs/macx-clang-arm64/Info.plist.disable_highdpi @@ -0,0 +1,8 @@ + + + + + NSHighResolutionCapable + NO + + diff --git a/mkspecs/macx-clang-arm64/Info.plist.lib b/mkspecs/macx-clang-arm64/Info.plist.lib new file mode 100644 index 0000000000..34752ec40d --- /dev/null +++ b/mkspecs/macx-clang-arm64/Info.plist.lib @@ -0,0 +1,20 @@ + + + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundlePackageType + FMWK + CFBundleShortVersionString + ${QMAKE_SHORT_VERSION} + CFBundleSignature + ${QMAKE_PKGINFO_TYPEINFO} + CFBundleVersion + ${QMAKE_FULL_VERSION} + NOTE + Please, do NOT change this file -- It was generated by Qt/QMake. + + diff --git a/mkspecs/macx-clang-arm64/qmake.conf b/mkspecs/macx-clang-arm64/qmake.conf new file mode 100644 index 0000000000..0cc2361e69 --- /dev/null +++ b/mkspecs/macx-clang-arm64/qmake.conf @@ -0,0 +1,7 @@ +# +# qmake configuration for Clang on OS X (arm64) +# + +QMAKE_APPLE_DEVICE_ARCHS=arm64 + +include(../common/clang-macx-desktop.conf) diff --git a/mkspecs/macx-clang-arm64/qplatformdefs.h b/mkspecs/macx-clang-arm64/qplatformdefs.h new file mode 100644 index 0000000000..063491dd90 --- /dev/null +++ b/mkspecs/macx-clang-arm64/qplatformdefs.h @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../common/mac/qplatformdefs.h" + diff --git a/mkspecs/macx-clang-x64/Info.plist.app b/mkspecs/macx-clang-x64/Info.plist.app new file mode 100644 index 0000000000..fa592af089 --- /dev/null +++ b/mkspecs/macx-clang-x64/Info.plist.app @@ -0,0 +1,24 @@ + + + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + ${ASSETCATALOG_COMPILER_APPICON_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundlePackageType + APPL + CFBundleSignature + ${QMAKE_PKGINFO_TYPEINFO} + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NOTE + This file was generated by Qt/QMake. + NSPrincipalClass + NSApplication + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/mkspecs/macx-clang-x64/Info.plist.dSYM.in b/mkspecs/macx-clang-x64/Info.plist.dSYM.in new file mode 100644 index 0000000000..a8c8d0d4fb --- /dev/null +++ b/mkspecs/macx-clang-x64/Info.plist.dSYM.in @@ -0,0 +1,18 @@ + + + + + CFBundleIdentifier + com.apple.xcode.dsym.$${BUNDLEIDENTIFIER} + CFBundlePackageType + dSYM + CFBundleSignature + ???? +!!IF !isEmpty(VERSION) + CFBundleShortVersionString + $${VER_MAJ}.$${VER_MIN} + CFBundleVersion + $${VER_MAJ}.$${VER_MIN}.$${VER_PAT} +!!ENDIF + + diff --git a/mkspecs/macx-clang-x64/Info.plist.disable_highdpi b/mkspecs/macx-clang-x64/Info.plist.disable_highdpi new file mode 100644 index 0000000000..a9b89888ad --- /dev/null +++ b/mkspecs/macx-clang-x64/Info.plist.disable_highdpi @@ -0,0 +1,8 @@ + + + + + NSHighResolutionCapable + NO + + diff --git a/mkspecs/macx-clang-x64/Info.plist.lib b/mkspecs/macx-clang-x64/Info.plist.lib new file mode 100644 index 0000000000..34752ec40d --- /dev/null +++ b/mkspecs/macx-clang-x64/Info.plist.lib @@ -0,0 +1,20 @@ + + + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundlePackageType + FMWK + CFBundleShortVersionString + ${QMAKE_SHORT_VERSION} + CFBundleSignature + ${QMAKE_PKGINFO_TYPEINFO} + CFBundleVersion + ${QMAKE_FULL_VERSION} + NOTE + Please, do NOT change this file -- It was generated by Qt/QMake. + + diff --git a/mkspecs/macx-clang-x64/qmake.conf b/mkspecs/macx-clang-x64/qmake.conf new file mode 100644 index 0000000000..1ac373b53b --- /dev/null +++ b/mkspecs/macx-clang-x64/qmake.conf @@ -0,0 +1,7 @@ +# +# qmake configuration for Clang on OS X (arm64) +# + +QMAKE_APPLE_DEVICE_ARCHS=x86_64 + +include(../common/clang-macx-desktop.conf) diff --git a/mkspecs/macx-clang-x64/qplatformdefs.h b/mkspecs/macx-clang-x64/qplatformdefs.h new file mode 100644 index 0000000000..063491dd90 --- /dev/null +++ b/mkspecs/macx-clang-x64/qplatformdefs.h @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../common/mac/qplatformdefs.h" + diff --git a/mkspecs/macx-clang/Info.plist.app b/mkspecs/macx-clang/Info.plist.app deleted file mode 100644 index fa592af089..0000000000 --- a/mkspecs/macx-clang/Info.plist.app +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - ${ASSETCATALOG_COMPILER_APPICON_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundlePackageType - APPL - CFBundleSignature - ${QMAKE_PKGINFO_TYPEINFO} - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - NOTE - This file was generated by Qt/QMake. - NSPrincipalClass - NSApplication - NSSupportsAutomaticGraphicsSwitching - - - diff --git a/mkspecs/macx-clang/Info.plist.dSYM.in b/mkspecs/macx-clang/Info.plist.dSYM.in deleted file mode 100644 index a8c8d0d4fb..0000000000 --- a/mkspecs/macx-clang/Info.plist.dSYM.in +++ /dev/null @@ -1,18 +0,0 @@ - - - - - CFBundleIdentifier - com.apple.xcode.dsym.$${BUNDLEIDENTIFIER} - CFBundlePackageType - dSYM - CFBundleSignature - ???? -!!IF !isEmpty(VERSION) - CFBundleShortVersionString - $${VER_MAJ}.$${VER_MIN} - CFBundleVersion - $${VER_MAJ}.$${VER_MIN}.$${VER_PAT} -!!ENDIF - - diff --git a/mkspecs/macx-clang/Info.plist.disable_highdpi b/mkspecs/macx-clang/Info.plist.disable_highdpi deleted file mode 100644 index a9b89888ad..0000000000 --- a/mkspecs/macx-clang/Info.plist.disable_highdpi +++ /dev/null @@ -1,8 +0,0 @@ - - - - - NSHighResolutionCapable - NO - - diff --git a/mkspecs/macx-clang/Info.plist.lib b/mkspecs/macx-clang/Info.plist.lib deleted file mode 100644 index 34752ec40d..0000000000 --- a/mkspecs/macx-clang/Info.plist.lib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundlePackageType - FMWK - CFBundleShortVersionString - ${QMAKE_SHORT_VERSION} - CFBundleSignature - ${QMAKE_PKGINFO_TYPEINFO} - CFBundleVersion - ${QMAKE_FULL_VERSION} - NOTE - Please, do NOT change this file -- It was generated by Qt/QMake. - - diff --git a/mkspecs/macx-clang/qmake.conf b/mkspecs/macx-clang/qmake.conf deleted file mode 100644 index 0cf1f31b60..0000000000 --- a/mkspecs/macx-clang/qmake.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# qmake configuration for Clang on OS X -# - -# Opt-in xcb QPA support with XQuartz: -# -# configure \ -# -pkg-config \ -# -fontconfig -system-freetype \ -# -xcb -no-opengl -# -# Ensure that pkg-config is properly configured, or that -# PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig -# is set in your build environment. -# -# If you don't want to use pkg-config, you can add: -# -L/opt/X11/lib -I/opt/X11/include -# to the configure options. -# -# Due to irreconcilable differences between Cocoa -# and X11, OpenGL is currently not supported. - -QMAKE_LIBS_X11 = -lX11 -lXext -lm -QMAKE_LIBDIR_X11 = /opt/X11/lib -QMAKE_INCDIR_X11 = /opt/X11/include - -include(../common/macx.conf) -include(../common/gcc-base-mac.conf) -include(../common/clang.conf) -include(../common/clang-mac.conf) - -load(qt_config) diff --git a/mkspecs/macx-clang/qplatformdefs.h b/mkspecs/macx-clang/qplatformdefs.h deleted file mode 100644 index 063491dd90..0000000000 --- a/mkspecs/macx-clang/qplatformdefs.h +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the qmake spec of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "../common/mac/qplatformdefs.h" -