mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 11:47:46 +00:00
Include basic framework for Steam API support
This commit is contained in:
parent
33f68c5586
commit
dc024aceb7
6 changed files with 41 additions and 3 deletions
|
@ -9,6 +9,7 @@ find_package(Qt5 COMPONENTS Core Widgets Network Quick CONFIG REQUIRED)
|
||||||
option(ENABLE_WATCHDOG "Build with Tesseract support (needed for Watchdog)" OFF)
|
option(ENABLE_WATCHDOG "Build with Tesseract support (needed for Watchdog)" OFF)
|
||||||
option(USE_OWN_LIBRARIES "Build with own libraries" OFF)
|
option(USE_OWN_LIBRARIES "Build with own libraries" OFF)
|
||||||
option(BUILD_FLATPAK "Build with Flatpak support in mind" OFF)
|
option(BUILD_FLATPAK "Build with Flatpak support in mind" OFF)
|
||||||
|
option(USE_STEAM "Build with Steam support" OFF)
|
||||||
|
|
||||||
if (ENABLE_WATCHDOG)
|
if (ENABLE_WATCHDOG)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
|
@ -22,6 +23,13 @@ if (NOT USE_OWN_LIBRARIES)
|
||||||
find_package(Qt5Keychain QUIET)
|
find_package(Qt5Keychain QUIET)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if(USE_STEAM)
|
||||||
|
add_library(Steamworks IMPORTED STATIC)
|
||||||
|
set_target_properties(Steamworks PROPERTIES
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${STEAMWORKS_INCLUDE_DIR}
|
||||||
|
IMPORTED_LOCATION ${STEAMWORKS_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
if (TARGET Qt5Keychain::Qt5Keychain)
|
if (TARGET Qt5Keychain::Qt5Keychain)
|
||||||
message("Using system library for Qt5 Keychain")
|
message("Using system library for Qt5 Keychain")
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,8 @@ set(HEADERS
|
||||||
include/sapphirelauncher.h
|
include/sapphirelauncher.h
|
||||||
include/squareboot.h
|
include/squareboot.h
|
||||||
include/squarelauncher.h
|
include/squarelauncher.h
|
||||||
include/patcher.h)
|
include/patcher.h
|
||||||
|
include/steamapi.h)
|
||||||
|
|
||||||
set(SRC
|
set(SRC
|
||||||
src/dxvkinstaller.cpp
|
src/dxvkinstaller.cpp
|
||||||
|
@ -19,7 +20,8 @@ set(SRC
|
||||||
src/sapphirelauncher.cpp
|
src/sapphirelauncher.cpp
|
||||||
src/squareboot.cpp
|
src/squareboot.cpp
|
||||||
src/squarelauncher.cpp
|
src/squarelauncher.cpp
|
||||||
src/patcher.cpp)
|
src/patcher.cpp
|
||||||
|
src/steamapi.cpp)
|
||||||
|
|
||||||
if (ENABLE_WATCHDOG)
|
if (ENABLE_WATCHDOG)
|
||||||
set(HEADERS ${HEADERS}
|
set(HEADERS ${HEADERS}
|
||||||
|
@ -28,7 +30,12 @@ if (ENABLE_WATCHDOG)
|
||||||
|
|
||||||
set(SRC ${SRC}
|
set(SRC ${SRC}
|
||||||
src/gameparser.cpp
|
src/gameparser.cpp
|
||||||
src/watchdog.cpp)
|
src/watchdog.cpp include/steamapi.h src/steamapi.cpp)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if(USE_STEAM)
|
||||||
|
set(LIBRARIES ${LIBRARIES}
|
||||||
|
Steamworks)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(astra_core STATIC ${HEADERS} ${SRC})
|
add_library(astra_core STATIC ${HEADERS} ${SRC})
|
||||||
|
@ -53,3 +60,7 @@ if (ENABLE_WATCHDOG)
|
||||||
|
|
||||||
target_compile_definitions(astra_core PUBLIC ENABLE_WATCHDOG)
|
target_compile_definitions(astra_core PUBLIC ENABLE_WATCHDOG)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if(USE_STEAM)
|
||||||
|
target_compile_definitions(astra_core PUBLIC USE_STEAM)
|
||||||
|
endif()
|
|
@ -10,6 +10,7 @@
|
||||||
#include <QtQml>
|
#include <QtQml>
|
||||||
|
|
||||||
#include "squareboot.h"
|
#include "squareboot.h"
|
||||||
|
#include "steamapi.h"
|
||||||
|
|
||||||
class SapphireLauncher;
|
class SapphireLauncher;
|
||||||
class SquareLauncher;
|
class SquareLauncher;
|
||||||
|
@ -223,4 +224,6 @@ private:
|
||||||
QString getDefaultWinePrefixPath();
|
QString getDefaultWinePrefixPath();
|
||||||
|
|
||||||
QVector<ProfileSettings*> profileSettings;
|
QVector<ProfileSettings*> profileSettings;
|
||||||
|
|
||||||
|
SteamAPI* steamApi = nullptr;
|
||||||
};
|
};
|
||||||
|
|
6
launcher/core/include/steamapi.h
Normal file
6
launcher/core/include/steamapi.h
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
class SteamAPI {
|
||||||
|
public:
|
||||||
|
SteamAPI();
|
||||||
|
};
|
|
@ -526,6 +526,7 @@ LauncherCore::LauncherCore()
|
||||||
squareLauncher = new SquareLauncher(*this);
|
squareLauncher = new SquareLauncher(*this);
|
||||||
squareBoot = new SquareBoot(*this, *squareLauncher);
|
squareBoot = new SquareBoot(*this, *squareLauncher);
|
||||||
assetUpdater = new AssetUpdater(*this);
|
assetUpdater = new AssetUpdater(*this);
|
||||||
|
steamApi = new SteamAPI();
|
||||||
|
|
||||||
#ifdef ENABLE_WATCHDOG
|
#ifdef ENABLE_WATCHDOG
|
||||||
watchdog = new Watchdog(*this);
|
watchdog = new Watchdog(*this);
|
||||||
|
|
9
launcher/core/src/steamapi.cpp
Normal file
9
launcher/core/src/steamapi.cpp
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#include "steamapi.h"
|
||||||
|
|
||||||
|
#include <steam/steam_api.h>
|
||||||
|
|
||||||
|
SteamAPI::SteamAPI() {
|
||||||
|
#ifdef USE_STEAM
|
||||||
|
SteamAPI_Init();
|
||||||
|
#endif
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue