[compat] fix solaris Qt build (#194)

Co-authored-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/194
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2025-08-15 04:12:45 +02:00 committed by crueter
parent c39e3bece6
commit e807e32b1a
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
21 changed files with 105 additions and 76 deletions

View file

@ -497,6 +497,11 @@ if (YUZU_ROOM)
target_link_libraries(yuzu PRIVATE yuzu-room)
endif()
# Explicit linking required
if (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
target_link_libraries(yuzu PRIVATE X11)
endif()
# Extra deps
add_subdirectory(externals)
target_link_libraries(yuzu PRIVATE QuaZip::QuaZip)

View file

@ -295,7 +295,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
api_restore_global_button = widget->restore_button;
if (!Settings::IsConfiguringGlobal()) {
QObject::connect(api_restore_global_button, &QAbstractButton::clicked,
api_restore_global_button->connect(api_restore_global_button, &QAbstractButton::clicked,
[this](bool) { UpdateAPILayout(); });
// Detach API's restore button and place it where we want
@ -327,7 +327,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
restore_button->setEnabled(true);
widget->layout()->addWidget(restore_button);
QObject::connect(restore_button, &QAbstractButton::clicked,
restore_button->connect(restore_button, &QAbstractButton::clicked,
[restore_button, this](bool) {
Settings::values.vsync_mode.SetGlobal(true);
PopulateVSyncModeSelection(true);
@ -340,7 +340,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
UpdateVsyncSetting();
restore_button->setVisible(true);
};
QObject::connect(widget->combobox, QOverload<int>::of(&QComboBox::activated),
widget->combobox->connect(widget->combobox, QOverload<int>::of(&QComboBox::activated),
[set_non_global]() { set_non_global(); });
vsync_restore_global_button = restore_button;
}
@ -379,7 +379,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
Settings::values.bg_red.UsingGlobal(), ui->bg_widget);
ui->bg_widget->layout()->addWidget(bg_restore_button);
QObject::connect(bg_restore_button, &QAbstractButton::clicked,
bg_restore_button->connect(bg_restore_button, &QAbstractButton::clicked,
[bg_restore_button, this](bool) {
const int r = Settings::values.bg_red.GetValue(true);
const int g = Settings::values.bg_green.GetValue(true);
@ -390,7 +390,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
bg_restore_button->setEnabled(false);
});
QObject::connect(ui->bg_button, &QAbstractButton::clicked, [bg_restore_button](bool) {
ui->bg_button->connect(ui->bg_button, &QAbstractButton::clicked, [bg_restore_button](bool) {
bg_restore_button->setVisible(true);
bg_restore_button->setEnabled(true);
});

View file

@ -2429,7 +2429,7 @@ void PlayerControlPreview::DrawProJoystick(QPainter& p, const QPointF center, co
1.0 - std::sqrt((offset.x() * offset.x()) + (offset.y() * offset.y())) * 0.1f);
const float rotation =
((offset.x() == 0) ? atan(1) * 2 : atan(offset.y() / offset.x())) * (180 / (atan(1) * 4));
((offset.x() == 0.f) ? std::atan(1.f) * 2.f : std::atan(offset.y() / offset.x())) * (180.f / (std::atan(1.f) * 4.f));
p.save();
p.translate(offset_center);

View file

@ -118,7 +118,7 @@ QWidget* Widget::CreateCheckBox(Settings::BasicSetting* bool_setting, const QStr
};
if (!Settings::IsConfiguringGlobal()) {
QObject::connect(checkbox, &QCheckBox::clicked, [touch]() { touch(); });
checkbox->connect(checkbox, &QCheckBox::clicked, [touch]() { touch(); });
}
return checkbox;
@ -165,7 +165,7 @@ QWidget* Widget::CreateCombobox(std::function<std::string()>& serializer,
};
if (!Settings::IsConfiguringGlobal()) {
QObject::connect(combobox, QOverload<int>::of(&QComboBox::activated),
combobox->connect(combobox, QOverload<int>::of(&QComboBox::activated),
[touch]() { touch(); });
}
@ -223,9 +223,8 @@ QWidget* Widget::CreateRadioGroup(std::function<std::string()>& serializer,
};
if (!Settings::IsConfiguringGlobal()) {
for (const auto& [id, button] : radio_buttons) {
QObject::connect(button, &QAbstractButton::clicked, [touch]() { touch(); });
}
for (const auto& [id, button] : radio_buttons)
button->connect(button, &QAbstractButton::clicked, [touch]() { touch(); });
}
return group;
@ -249,7 +248,7 @@ QWidget* Widget::CreateLineEdit(std::function<std::string()>& serializer,
};
if (!Settings::IsConfiguringGlobal()) {
QObject::connect(line_edit, &QLineEdit::textChanged, [touch]() { touch(); });
line_edit->connect(line_edit, &QLineEdit::textChanged, [touch]() { touch(); });
}
return line_edit;
@ -266,7 +265,7 @@ static void CreateIntSlider(Settings::BasicSetting& setting, bool reversed, floa
feedback->setText(use_format.arg(QVariant::fromValue(present).value<QString>()));
};
QObject::connect(slider, &QAbstractSlider::valueChanged, update_feedback);
slider->connect(slider, &QAbstractSlider::valueChanged, update_feedback);
update_feedback(std::strtol(setting.ToString().c_str(), nullptr, 0));
slider->setMinimum(std::strtol(setting.MinVal().c_str(), nullptr, 0));
@ -293,7 +292,7 @@ static void CreateFloatSlider(Settings::BasicSetting& setting, bool reversed, fl
feedback->setText(use_format.arg(QVariant::fromValue(present).value<QString>()));
};
QObject::connect(slider, &QAbstractSlider::valueChanged, update_feedback);
slider->connect(slider, &QAbstractSlider::valueChanged, update_feedback);
update_feedback(std::strtof(setting.ToString().c_str(), nullptr));
slider->setMinimum(min_val * use_multiplier);
@ -346,7 +345,7 @@ QWidget* Widget::CreateSlider(bool reversed, float multiplier, const QString& gi
slider->setInvertedAppearance(reversed);
if (!Settings::IsConfiguringGlobal()) {
QObject::connect(slider, &QAbstractSlider::actionTriggered, [touch]() { touch(); });
slider->connect(slider, &QAbstractSlider::actionTriggered, [touch]() { touch(); });
}
return container;
@ -376,7 +375,7 @@ QWidget* Widget::CreateSpinBox(const QString& given_suffix,
};
if (!Settings::IsConfiguringGlobal()) {
QObject::connect(spinbox, QOverload<int>::of(&QSpinBox::valueChanged), [this, touch]() {
spinbox->connect(spinbox, QOverload<int>::of(&QSpinBox::valueChanged), [this, touch]() {
if (spinbox->value() != std::strtol(setting.ToStringGlobal().c_str(), nullptr, 0)) {
touch();
}
@ -410,7 +409,7 @@ QWidget* Widget::CreateDoubleSpinBox(const QString& given_suffix,
};
if (!Settings::IsConfiguringGlobal()) {
QObject::connect(double_spinbox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
double_spinbox->connect(double_spinbox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
[this, touch]() {
if (double_spinbox->value() !=
std::strtod(setting.ToStringGlobal().c_str(), nullptr)) {
@ -453,8 +452,7 @@ QWidget* Widget::CreateHexEdit(std::function<std::string()>& serializer,
restore_func = [this, to_hex]() { line_edit->setText(to_hex(RelevantDefault(setting))); };
if (!Settings::IsConfiguringGlobal()) {
QObject::connect(line_edit, &QLineEdit::textChanged, [touch]() { touch(); });
line_edit->connect(line_edit, &QLineEdit::textChanged, [touch]() { touch(); });
}
return line_edit;
@ -488,7 +486,7 @@ QWidget* Widget::CreateDateTimeEdit(bool disabled, bool restrict,
restore_func = [this, get_clear_val]() { date_time_edit->setDateTime(get_clear_val()); };
if (!Settings::IsConfiguringGlobal()) {
QObject::connect(date_time_edit, &QDateTimeEdit::editingFinished,
date_time_edit->connect(date_time_edit, &QDateTimeEdit::editingFinished,
[this, get_clear_val, touch]() {
if (date_time_edit->dateTime() != get_clear_val()) {
touch();
@ -665,7 +663,7 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
} else {
layout->addWidget(restore_button);
QObject::connect(restore_button, &QAbstractButton::clicked,
restore_button->connect(restore_button, &QAbstractButton::clicked,
[this, restore_func, checkbox_restore_func](bool) {
LOG_DEBUG(Frontend, "Restore global state for \"{}\"",
setting.GetLabel());

View file

@ -100,7 +100,7 @@ void DiscordImpl::Update() {
request.setTransferTimeout(3000);
QNetworkReply* reply = manager.head(request);
QEventLoop request_event_loop;
QObject::connect(reply, &QNetworkReply::finished, &request_event_loop, &QEventLoop::quit);
reply->connect(reply, &QNetworkReply::finished, &request_event_loop, &QEventLoop::quit);
request_event_loop.exec();
UpdateGameStatus(reply->error());

View file

@ -536,7 +536,7 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
}
return QString{};
});
QObject::connect(&update_watcher, &QFutureWatcher<QString>::finished, this,
update_watcher.connect(&update_watcher, &QFutureWatcher<QString>::finished, this,
&GMainWindow::OnEmulatorUpdateAvailable);
update_watcher.setFuture(update_future);
}
@ -5786,7 +5786,7 @@ int main(int argc, char* argv[]) {
// After settings have been loaded by GMainWindow, apply the filter
main_window.show();
QObject::connect(&app, &QGuiApplication::applicationStateChanged, &main_window,
app.connect(&app, &QGuiApplication::applicationStateChanged, &main_window,
&GMainWindow::OnAppFocusStateChanged);
int result = app.exec();

View file

@ -7,7 +7,7 @@
#include <cstring>
#include <processthreadsapi.h>
#include <windows.h>
#elif defined(YUZU_UNIX)
#else
#include <cstring>
#include <errno.h>
#include <spawn.h>
@ -56,7 +56,7 @@ bool CheckEnvVars(bool* is_child) {
IS_CHILD_ENV_VAR, GetLastError());
return true;
}
#elif defined(YUZU_UNIX)
#else
const char* startup_check_var = getenv(STARTUP_CHECK_ENV_VAR);
if (startup_check_var != nullptr &&
std::strncmp(startup_check_var, ENV_VAR_ENABLED_TEXT, 8) == 0) {
@ -110,7 +110,7 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan, bool perform_vulka
STARTUP_CHECK_ENV_VAR, GetLastError());
}
#elif defined(YUZU_UNIX)
#else
const int env_var_set = setenv(STARTUP_CHECK_ENV_VAR, ENV_VAR_ENABLED_TEXT, 1);
if (env_var_set == -1) {
const int err = errno;
@ -175,7 +175,7 @@ bool SpawnChild(const char* arg0, PROCESS_INFORMATION* pi, int flags) {
return true;
}
#elif defined(YUZU_UNIX)
#else
pid_t SpawnChild(const char* arg0) {
const pid_t pid = fork();

View file

@ -5,7 +5,7 @@
#ifdef _WIN32
#include <windows.h>
#elif defined(YUZU_UNIX)
#else
#include <sys/types.h>
#endif
@ -19,6 +19,6 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan, bool perform_vulka
#ifdef _WIN32
bool SpawnChild(const char* arg0, PROCESS_INFORMATION* pi, int flags);
#elif defined(YUZU_UNIX)
#else
pid_t SpawnChild(const char* arg0);
#endif