From e4c5e99d0f891b01913bf3bf2ef3cb04c82e6d1b Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 7 Mar 2023 20:14:37 +0100 Subject: [PATCH] MainWindow: Add macOS warning if running on different CPU --- src/core/mainwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/mainwindow.cpp b/src/core/mainwindow.cpp index 2ec312ac..484d58bf 100644 --- a/src/core/mainwindow.cpp +++ b/src/core/mainwindow.cpp @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -1036,6 +1037,14 @@ MainWindow::MainWindow(Application *app, std::shared_ptr tray_ic } #endif +#if defined(Q_OS_MACOS) + if (QSysInfo::buildCpuArchitecture() != QSysInfo::currentCpuArchitecture()) { + QErrorMessage *error_message = new QErrorMessage; + error_message->setAttribute(Qt::WA_DeleteOnClose); + error_message->showMessage(tr("This Strawberry binary was built for %1 CPU, but you are running on an %2 CPU. Strawberry currently have limited macOS support, and running this binary on the current CPU is unsupported. If you want to use Strawberry on the current CPU, you should build Strawberry from source. For instructions see.: https://wiki.strawberrymusicplayer.org/wiki/Compile").arg(QSysInfo::buildCpuArchitecture()).arg(QSysInfo::currentCpuArchitecture())); + } +#endif + qLog(Debug) << "Started" << QThread::currentThread(); initialized_ = true;