lime_qt: Fixed Qt resources (.qrc) not linking correctly after the change to a static library

This commit is contained in:
OpenSauce04 2024-10-23 18:21:40 +01:00
parent 8d937c0924
commit 3042090227
8 changed files with 17 additions and 1 deletions

View File

@ -88,10 +88,13 @@ option(ENABLE_LTO "Enable link time optimization" ${DEFAULT_ENABLE_LTO})
option(LIME3DS_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
option(LIME3DS_WARNINGS_AS_ERRORS "Enable warnings as errors" ON)
# Pass ENABLE_QT and ENABLE_SDL2_FRONTEND to C++ land
# Pass the following values to C++ land
if (ENABLE_QT)
add_definitions(-DENABLE_QT)
endif()
if (ENABLE_QT_TRANSLATION)
add_definitions(-DENABLE_QT_TRANSLATION)
endif()
if (ENABLE_SDL2_FRONTEND)
add_definitions(-DENABLE_SDL2_FRONTEND)
endif()

View File

@ -3755,6 +3755,19 @@ void LaunchQtFrontend(int argc, char* argv[]) {
QApplication app(argc, argv);
// Required when using .qrc resources from within a static library.
// See https://doc.qt.io/qt-5/resources.html#using-resources-in-a-library
Q_INIT_RESOURCE(compatibility_list);
Q_INIT_RESOURCE(theme_colorful);
Q_INIT_RESOURCE(theme_colorful_dark);
Q_INIT_RESOURCE(theme_colorful_midnight_blue);
Q_INIT_RESOURCE(theme_default);
Q_INIT_RESOURCE(theme_qdarkstyle);
Q_INIT_RESOURCE(theme_qdarkstyle_midnight_blue);
#ifdef ENABLE_QT_TRANSLATION
Q_INIT_RESOURCE(languages);
#endif
// Qt changes the locale and causes issues in float conversion using std::to_string() when
// generating shaders
setlocale(LC_ALL, "C");