Merge pull request #14778 from JoshuaVandaele/about-enable-sdl
AboutDialog: Fix compilation with ENABLE_SDL=OFF
This commit is contained in:
@@ -697,6 +697,7 @@ endif()
|
|||||||
|
|
||||||
if(ENABLE_SDL)
|
if(ENABLE_SDL)
|
||||||
dolphin_find_optional_system_library(SDL3 Externals/SDL 3.2.0)
|
dolphin_find_optional_system_library(SDL3 Externals/SDL 3.2.0)
|
||||||
|
add_definitions(-DHAVE_SDL3)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
dolphin_find_optional_system_library(SFML Externals/SFML 3.0 COMPONENTS Network System)
|
dolphin_find_optional_system_library(SFML Externals/SFML 3.0 COMPONENTS Network System)
|
||||||
|
|||||||
@@ -7,7 +7,9 @@
|
|||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#ifdef HAVE_SDL3
|
||||||
#include <SDL3/SDL_version.h>
|
#include <SDL3/SDL_version.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "Common/Version.h"
|
#include "Common/Version.h"
|
||||||
|
|
||||||
@@ -27,11 +29,13 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
|
|||||||
tr("%1 commit(s) ahead of %2").arg(commits_ahead).arg(QStringLiteral("master")));
|
tr("%1 commit(s) ahead of %2").arg(commits_ahead).arg(QStringLiteral("master")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_SDL3
|
||||||
const int sdl_version = SDL_GetVersion();
|
const int sdl_version = SDL_GetVersion();
|
||||||
QString sdl_str = QString::fromStdString("%1.%2.%3")
|
QString sdl_str = QString::fromStdString("%1.%2.%3")
|
||||||
.arg(SDL_VERSIONNUM_MAJOR(sdl_version))
|
.arg(SDL_VERSIONNUM_MAJOR(sdl_version))
|
||||||
.arg(SDL_VERSIONNUM_MINOR(sdl_version))
|
.arg(SDL_VERSIONNUM_MINOR(sdl_version))
|
||||||
.arg(SDL_VERSIONNUM_MICRO(sdl_version));
|
.arg(SDL_VERSIONNUM_MICRO(sdl_version));
|
||||||
|
#endif
|
||||||
|
|
||||||
const QString text =
|
const QString text =
|
||||||
QStringLiteral(R"(
|
QStringLiteral(R"(
|
||||||
@@ -72,7 +76,11 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
|
|||||||
tr("Revision: %1").arg(QString::fromUtf8(Common::GetScmRevGitStr().c_str())))
|
tr("Revision: %1").arg(QString::fromUtf8(Common::GetScmRevGitStr().c_str())))
|
||||||
.replace(QStringLiteral("%QT_VERSION%"),
|
.replace(QStringLiteral("%QT_VERSION%"),
|
||||||
tr("Using Qt %1").arg(QStringLiteral(QT_VERSION_STR)))
|
tr("Using Qt %1").arg(QStringLiteral(QT_VERSION_STR)))
|
||||||
|
#ifdef HAVE_SDL3
|
||||||
.replace(QStringLiteral("%SDL_VERSION%"), tr("Using SDL %1").arg(sdl_str))
|
.replace(QStringLiteral("%SDL_VERSION%"), tr("Using SDL %1").arg(sdl_str))
|
||||||
|
#else
|
||||||
|
.replace(QStringLiteral("%SDL_VERSION%"), tr("SDL disabled"))
|
||||||
|
#endif
|
||||||
.replace(QStringLiteral("%CHECK_FOR_UPDATES%"), tr("Check for updates"))
|
.replace(QStringLiteral("%CHECK_FOR_UPDATES%"), tr("Check for updates"))
|
||||||
.replace(QStringLiteral("%ABOUT_DOLPHIN%"),
|
.replace(QStringLiteral("%ABOUT_DOLPHIN%"),
|
||||||
// i18n: The word "free" in the standard phrase "free and open source"
|
// i18n: The word "free" in the standard phrase "free and open source"
|
||||||
|
|||||||
@@ -458,9 +458,15 @@ PRIVATE
|
|||||||
uicommon
|
uicommon
|
||||||
imgui
|
imgui
|
||||||
implot
|
implot
|
||||||
SDL3::SDL3
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_SDL)
|
||||||
|
target_link_libraries(dolphin-emu
|
||||||
|
PRIVATE
|
||||||
|
SDL3::SDL3
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NEED_QT_GUI_PRIVATE_COMPONENT)
|
if (NEED_QT_GUI_PRIVATE_COMPONENT)
|
||||||
target_link_libraries(dolphin-emu
|
target_link_libraries(dolphin-emu
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|||||||
@@ -181,7 +181,6 @@ if(ENABLE_SDL)
|
|||||||
ControllerInterface/SDL/SDLGamepad.h
|
ControllerInterface/SDL/SDLGamepad.h
|
||||||
)
|
)
|
||||||
target_link_libraries(inputcommon PRIVATE SDL3::SDL3)
|
target_link_libraries(inputcommon PRIVATE SDL3::SDL3)
|
||||||
target_compile_definitions(inputcommon PUBLIC HAVE_SDL3=1)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
|||||||
Reference in New Issue
Block a user