From c45f8d95cf3cc9f9ce8953dce94ca7e266121928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 14 Mar 2022 16:15:53 +0100 Subject: macOS: Update docs for specifying build architecture Change-Id: I60c8ba70030bf4449eeb4983c8ec570cdf31b228 Reviewed-by: Alexandru Croitor --- doc/src/platforms/macos.qdoc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/doc/src/platforms/macos.qdoc b/doc/src/platforms/macos.qdoc index c213a679..f07df304 100644 --- a/doc/src/platforms/macos.qdoc +++ b/doc/src/platforms/macos.qdoc @@ -145,17 +145,24 @@ \section2 Architectures - By default, Qt is built for x86_64. To build for x86_64h (Haswell). use the - \c QMAKE_APPLE_DEVICE_ARCHS \c qmake variable. - This is selectable at configure time: + By default, Qt will build for the architecture of your development machine - + either \c x86_64, or \c arm64 if you are on an Apple Silicon Mac. + + To build for other architectures you can use the \c QMAKE_APPLE_DEVICE_ARCHS variables + in your project files or on the command line. This allows you to both cross-compile + to a different architecture, and to build universal (multi-architecture) binaries. + For example, to build your application for both \c x86_64 and \c arm64: + \code - ./configure -platform macx-clang QMAKE_APPLE_DEVICE_ARCHS=x86_64h + qmake ~/src/myapp QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" \endcode - \c QMAKE_APPLE_DEVICE_ARCHS can also be specified as a space-delimited list - in order to build for multiple architectures simultaneously: + When specifying the architectures in a project file they should not be quoted, e.g.: + \code - ./configure -platform macx-clang QMAKE_APPLE_DEVICE_ARCHS="x86_64 x86_64h" + TEMPLATE = app + SOURCES = main.cpp + QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64 \endcode \section1 Additional Command-Line Options -- cgit v1.2.1