forked from qt-creator/qt-creator
Add workarounds for running under Rosetta on macOS
When Qt Creator is built as an Intel binary, and runs on an Apple Silicon (ARM) Mac, it will be run via the Rosetta translation layer. This means any process spawned by QtC, including qmake, CMake, and lldb, will launch as x86_64 binaries as well. For qmake and CMake, this affects their default choice of build architecture, resulting in x86_64 builds of user applications. We want to produce native arm64 apps, even if Qt Creator itself isn't one, so we explicitly detect the situation, and if Qt has an arm64 slice, we default to arm64 builds. The logic of adding CONFIG+=x86_64 to the qmake step has been disabled, as the assumption that a single qmake run and build will produce only a single architecture does no longer hold. The corresponding logic in Qt was removed in 2015 (qtbase f58e95f098c8d78a5f2db7729606126fe093cbdf). In the case of lldb, running it as an x86_64 binary fails to attach to the running application. We work around this by using the 'arch' tool to explicitly launch it as an arm64 binary. This works for debugging both arm64 and x86_64 applications. Change-Id: I65cc0f600223990f25c76cef18d927895e551260 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <projectexplorer/projectexplorersettings.h>
|
||||
#include <projectexplorer/task.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
Reference in New Issue
Block a user