MainWindow: Add macOS warning if running on different CPU

This commit is contained in:
Jonas Kvinge 2023-03-07 20:14:37 +01:00
parent 80cfca5de2
commit e4c5e99d0f
1 changed files with 9 additions and 0 deletions

View File

@ -59,6 +59,7 @@
#include <QActionGroup>
#include <QShortcut>
#include <QMessageBox>
#include <QErrorMessage>
#include <QtEvents>
#include <QSettings>
#include <QColor>
@ -1036,6 +1037,14 @@ MainWindow::MainWindow(Application *app, std::shared_ptr<SystemTrayIcon> 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;