Skip to content

Commit

Permalink
add install to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
biscuitcakes committed Feb 20, 2024
1 parent cea55b3 commit f36a0bb
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 97 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ artifact
.gitbak
out
build
release
userdata
system
roms
build-old

.obsidian
Expand Down
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ qt_standard_project_setup(REQUIRES 6.5)
set(CMAKE_CXX_STANDARD 17)

add_library(firelight_lib
# ${DISCORD_SOURCES}
src/app/libretro/core.cpp
src/app/libretro/coreoption.cpp
src/app/libretro/coreoption.hpp
Expand Down Expand Up @@ -96,7 +97,7 @@ add_library(firelight_lib
src/app/input/controller_list_model.hpp
)

target_include_directories(firelight_lib PRIVATE includes includes/imgui ${SDL2_INCLUDE_DIRS}
target_include_directories(firelight_lib PRIVATE includes ${SDL2_INCLUDE_DIRS}
${SQLite3_INCLUDE_DIRS})
target_link_libraries(firelight_lib mingw32 SDL2main SDL2 opengl32 ssl crypto ${SQLite3_LIBRARIES}
Qt6::Gui Qt6::Quick Qt6::OpenGL Qt6::QuickControls2 Qt6::Quick3D Qt6::Sql spdlog::spdlog)
Expand Down Expand Up @@ -150,7 +151,7 @@ qt_add_qml_module(firelight_style
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/FirelightStyle"
)

target_include_directories(firelight PRIVATE includes includes/imgui ${SDL2_INCLUDE_DIRS}
target_include_directories(firelight PRIVATE includes ${SDL2_INCLUDE_DIRS}
${SQLite3_INCLUDE_DIRS})
target_link_libraries(firelight PRIVATE firelight_lib)

Expand Down Expand Up @@ -186,3 +187,8 @@ target_link_libraries(fl_test PRIVATE firelight_lib ${GTEST_BOTH_LIBRARIES})
#
#add_test(NAME firelight_test COMMAND firelight)

qt_generate_deploy_qml_app_script(
TARGET firelight
OUTPUT_SCRIPT deploy_script
)
install(SCRIPT ${deploy_script})
101 changes: 101 additions & 0 deletions build-windows-testing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
DEST_FOLDER=artifact

mkdir ${DEST_FOLDER} || true

cp build/firelight.exe ${DEST_FOLDER}/firelight.exe

#/c/Qt/6.6.1/mingw_64/bin/windeployqt.exe --add-plugin-types=imageformats,iconengines,platforms,platforminputcontexts,\
#qmltooling,quick,quickcontrols2,quicktemplates2,quickwidgets,sql,tls,styles,sqldrivers,svg,translations,webp \
# ${DEST_FOLDER}/firelight.exe

cp /c/msys64/mingw64/bin/libgcc_s_seh-1.dll ${DEST_FOLDER}/libgcc_s_seh-1.dll
cp /c/msys64/mingw64/bin/libstdc++-6.dll ${DEST_FOLDER}/libstdc++-6.dll
cp /c/msys64/mingw64/bin/libwinpthread-1.dll ${DEST_FOLDER}/libwinpthread-1.dll

cp /c/msys64/mingw64/bin/SDL2.dll ${DEST_FOLDER}/SDL2.dll
cp /c/msys64/mingw64/bin/libssl-3-x64.dll ${DEST_FOLDER}/libssl-3-x64.dll
cp /c/msys64/mingw64/bin/libcrypto-3-x64.dll ${DEST_FOLDER}/libcrypto-3-x64.dll

cp build/qtquickcontrols2.conf ${DEST_FOLDER}/qtquickcontrols2.conf

cp /c/msys64/mingw64/bin/Qt6Core.dll ${DEST_FOLDER}/Qt6Core.dll
cp /c/msys64/mingw64/bin/Qt6Gui.dll ${DEST_FOLDER}/Qt6Gui.dll
cp /c/msys64/mingw64/bin/Qt6Network.dll ${DEST_FOLDER}/Qt6Network.dll
cp /c/msys64/mingw64/bin/Qt6OpenGL.dll ${DEST_FOLDER}/Qt6OpenGL.dll
cp /c/msys64/mingw64/bin/Qt6Pdf.dll ${DEST_FOLDER}/Qt6Pdf.dll
cp /c/msys64/mingw64/bin/Qt6Qml.dll ${DEST_FOLDER}/Qt6Qml.dll
cp /c/msys64/mingw64/bin/Qt6Quick.dll ${DEST_FOLDER}/Qt6Quick.dll
cp /c/msys64/mingw64/bin/Qt6Quick3DUtils.dll ${DEST_FOLDER}/Qt6Quick3DUtils.dll
cp /c/msys64/mingw64/bin/Qt6Sql.dll ${DEST_FOLDER}/Qt6Sql.dll
cp /c/msys64/mingw64/bin/Qt6Svg.dll ${DEST_FOLDER}/Qt6Svg.dll
cp /c/msys64/mingw64/bin/Qt6VirtualKeyboard.dll ${DEST_FOLDER}/Qt6VirtualKeyboard.dll
cp /c/msys64/mingw64/bin/Qt6Qml.dll ${DEST_FOLDER}/Qt6Qml.dll
cp /c/msys64/mingw64/bin/Qt6QmlModels.dll ${DEST_FOLDER}/Qt6QmlModels.dll
cp /c/msys64/mingw64/bin/Qt6QmlWorkerScript.dll ${DEST_FOLDER}/Qt6QmlWorkerScript.dll
cp /c/msys64/mingw64/bin/Qt6QuickControls2.dll ${DEST_FOLDER}/Qt6QuickControls2.dll
cp /c/msys64/mingw64/bin/Qt6QuickControls2Impl.dll ${DEST_FOLDER}/Qt6QuickControls2Impl.dll
cp /c/msys64/mingw64/bin/Qt6QuickDialogs2.dll ${DEST_FOLDER}/Qt6QuickDialogs2.dll
cp /c/msys64/mingw64/bin/Qt6QuickDialogs2QuickImpl.dll ${DEST_FOLDER}/Qt6QuickDialogs2QuickImpl.dll
cp /c/msys64/mingw64/bin/Qt6QuickDialogs2Utils.dll ${DEST_FOLDER}/Qt6QuickDialogs2Utils.dll
cp /c/msys64/mingw64/bin/Qt6QuickEffects.dll ${DEST_FOLDER}/Qt6QuickEffects.dll
cp /c/msys64/mingw64/bin/Qt6QuickLayouts.dll ${DEST_FOLDER}/Qt6QuickLayouts.dll
cp /c/msys64/mingw64/bin/Qt6QuickShapes.dll ${DEST_FOLDER}/Qt6QuickShapes.dll
cp /c/msys64/mingw64/bin/Qt6QuickTemplates2.dll ${DEST_FOLDER}/Qt6QuickTemplates2.dll

mkdir ${DEST_FOLDER}/generic || true
cp /c/msys64/mingw64/share/qt6/plugins/generic/qtuiotouchplugin.dll ${DEST_FOLDER}/generic/qtuiotouchplugin.dll

mkdir ${DEST_FOLDER}/iconengines || true
cp /c/msys64/mingw64/share/qt6/plugins/iconengines/qsvgicon.dll ${DEST_FOLDER}/iconengines/qsvgicon.dll

mkdir ${DEST_FOLDER}/imageformats || true
cp /c/msys64/mingw64/share/qt6/plugins/imageformats/qgif.dll ${DEST_FOLDER}/imageformats/qgif.dll
cp /c/msys64/mingw64/share/qt6/plugins/imageformats/qicns.dll ${DEST_FOLDER}/imageformats/qicns.dll
cp /c/msys64/mingw64/share/qt6/plugins/imageformats/qico.dll ${DEST_FOLDER}/imageformats/qico.dll
cp /c/msys64/mingw64/share/qt6/plugins/imageformats/qjpeg.dll ${DEST_FOLDER}/imageformats/qjpeg.dll
## PDF??
cp /c/msys64/mingw64/share/qt6/plugins/imageformats/qsvg.dll ${DEST_FOLDER}/imageformats/qsvg.dll
cp /c/msys64/mingw64/share/qt6/plugins/imageformats/qtga.dll ${DEST_FOLDER}/imageformats/qtga.dll
cp /c/msys64/mingw64/share/qt6/plugins/imageformats/qtiff.dll ${DEST_FOLDER}/imageformats/qtiff.dll
cp /c/msys64/mingw64/share/qt6/plugins/imageformats/qwbmp.dll ${DEST_FOLDER}/imageformats/qwbmp.dll
cp /c/msys64/mingw64/share/qt6/plugins/imageformats/qwebp.dll ${DEST_FOLDER}/imageformats/qwebp.dll

mkdir ${DEST_FOLDER}/networkinformation || true
cp /c/msys64/mingw64/share/qt6/plugins/networkinformation/qnetworklistmanager.dll ${DEST_FOLDER}/networkinformation/qnetworklistmanager.dll

mkdir ${DEST_FOLDER}/platforminputcontexts || true
cp /c/msys64/mingw64/share/qt6/plugins/platforminputcontexts/qtvirtualkeyboardplugin.dll ${DEST_FOLDER}/platforminputcontexts/qtvirtualkeyboardplugin.dll

mkdir ${DEST_FOLDER}/platforms || true
cp /c/msys64/mingw64/share/qt6/plugins/platforms/qwindows.dll ${DEST_FOLDER}/platforms/qwindows.dll

mkdir ${DEST_FOLDER}/qml || true

mkdir ${DEST_FOLDER}/qmltooling || true
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_debugger.dll ${DEST_FOLDER}/qmltooling/qmldbg_debugger.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_inspector.dll ${DEST_FOLDER}/qmltooling/qmldbg_inspector.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_local.dll ${DEST_FOLDER}/qmltooling/qmldbg_local.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_messages.dll ${DEST_FOLDER}/qmltooling/qmldbg_messages.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_native.dll ${DEST_FOLDER}/qmltooling/qmldbg_native.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_nativedebugger.dll ${DEST_FOLDER}/qmltooling/qmldbg_nativedebugger.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_preview.dll ${DEST_FOLDER}/qmltooling/qmldbg_preview.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_profiler.dll ${DEST_FOLDER}/qmltooling/qmldbg_profiler.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_quick3dprofiler.dll ${DEST_FOLDER}/qmltooling/qmldbg_quick3dprofiler.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_quickprofiler.dll ${DEST_FOLDER}/qmltooling/qmldbg_quickprofiler.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_server.dll ${DEST_FOLDER}/qmltooling/qmldbg_server.dll
cp /c/msys64/mingw64/share/qt6/plugins/qmltooling/qmldbg_tcp.dll ${DEST_FOLDER}/qmltooling/qmldbg_tcp.dll

mkdir ${DEST_FOLDER}/sqldrivers || true
cp /c/msys64/mingw64/share/qt6/plugins/sqldrivers/qsqlite.dll ${DEST_FOLDER}/sqldrivers/qsqlite.dll
cp /c/msys64/mingw64/share/qt6/plugins/sqldrivers/qsqlmimer.dll ${DEST_FOLDER}/sqldrivers/qsqlmimer.dll
cp /c/msys64/mingw64/share/qt6/plugins/sqldrivers/qsqlodbc.dll ${DEST_FOLDER}/sqldrivers/qsqlodbc.dll
cp /c/msys64/mingw64/share/qt6/plugins/sqldrivers/qsqlpsql.dll ${DEST_FOLDER}/sqldrivers/qsqlpsql.dll

mkdir ${DEST_FOLDER}/tls || true
cp /c/msys64/mingw64/share/qt6/plugins/tls/qcertonlybackend.dll ${DEST_FOLDER}/tls/qcertonlybackend.dll
cp /c/msys64/mingw64/share/qt6/plugins/tls/qopensslbackend.dll ${DEST_FOLDER}/tls/qopensslbackend.dll
cp /c/msys64/mingw64/share/qt6/plugins/tls/qschannelbackend.dll ${DEST_FOLDER}/tls/qschannelbackend.dll

#mkdir ${DEST_FOLDER}/translations

#/c/Qt/6.6.1/mingw_64/bin/windeployqt.exe ${DEST_FOLDER}/firelight.exe
5 changes: 0 additions & 5 deletions build-windows.sh

This file was deleted.

80 changes: 0 additions & 80 deletions dbtesting.sql

This file was deleted.

Binary file added lib/x86_64/discord_game_sdk.dll
Binary file not shown.
Binary file added lib/x86_64/discord_game_sdk.dll.lib
Binary file not shown.
5 changes: 4 additions & 1 deletion src/gui/save_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ class SaveManager : public QObject {

signals:
void saveDataChanged();
void suspendPointCreated();
void suspendPointLoaded();

public:
explicit SaveManager(std::filesystem::path saveDir);
QFuture<bool> writeSaveDataForEntry(LibEntry &entry, SaveData &saveData) const;
QFuture<bool> writeSaveDataForEntry(LibEntry &entry,
SaveData &saveData) const;
std::optional<SaveData> readSaveDataForEntry(LibEntry &entry) const;

private:
Expand Down
16 changes: 7 additions & 9 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
const int SCREEN_WIDTH = 1280;
const int SCREEN_HEIGHT = 720;

bool create_dirs(const std::initializer_list<std::filesystem::path> list)
{
bool create_dirs(const std::initializer_list<std::filesystem::path> list) {
std::error_code error_code;
for (const auto& path : list) {
if (!exists(path))
{
for (const auto &path : list) {
if (!exists(path)) {
spdlog::info("Directory not found, creating: {}", path.string());
if (!create_directories(path, error_code)) {
spdlog::error("Unable to create directory {}; Error code: {}", path.string(), error_code.message());
spdlog::error("Unable to create directory {}; Error code: {}",
path.string(), error_code.message());
return false;
}
}
Expand All @@ -55,12 +54,11 @@ int main(int argc, char *argv[]) {
auto roms_dir = appdata_dir / "roms";
auto save_dir = userdata_dir / "savedata";

if (!create_dirs({ appdata_dir, system_dir, userdata_dir, roms_dir, save_dir } )) {
if (!create_dirs(
{appdata_dir, system_dir, userdata_dir, roms_dir, save_dir})) {
return 1;
}



// QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
QGuiApplication app(argc, argv);

Expand Down

0 comments on commit f36a0bb

Please sign in to comment.