1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-06-07 14:37:45 +00:00

Rip out Steamworks integration for now

This commit is contained in:
Joshua Goins 2023-12-20 19:36:59 -05:00
parent 01e433fe4f
commit 4da74915c9
5 changed files with 4 additions and 47 deletions

View file

@ -52,7 +52,6 @@ Remember that unless you're running in a kdesrc-build session you need to set so
When configuring Astra, there are several optional features you may want to enable or disable:
* `ENABLE_STEAM`: Steam integration, requires the Steamworks SDK.
* `ENABLE_GAMEMODE`: Gamemode integration, requires Gamemode.
To configure, run `cmake` in the source directory:
@ -65,7 +64,7 @@ $ cmake -S . -B build
This command will create a new build directory and configure the source directory (`.`). If you want to enable more options, pass them now:
```bash
$ cmake -S . -B build -DENABLE_STEAM=ON
$ cmake -S . -B build -DENABLE_GAMEMODE=ON
```
## Building

View file

@ -8,7 +8,6 @@ project(Astra VERSION 0.5.0 LANGUAGES CXX)
option(BUILD_FLATPAK "Build for Flatpak." OFF)
# options for features you may want or need
option(ENABLE_STEAM "Build with Steam support, requires supplying the Steam SDK yourself." OFF)
option(ENABLE_GAMEMODE "Build with Feral GameMode support, requires the daemon to be installed." ON)
set(CMAKE_CXX_STANDARD 20)
@ -53,17 +52,6 @@ if (ENABLE_GAMEMODE)
pkg_search_module(GAMEMODE REQUIRED gamemode)
endif ()
if (ENABLE_STEAM)
add_library(Steamworks IMPORTED SHARED)
set_target_properties(Steamworks PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${STEAMWORKS_INCLUDE_DIR}
IMPORTED_LOCATION ${STEAMWORKS_LIBRARIES})
if (BUILD_FLATPAK)
install(IMPORTED_RUNTIME_ARTIFACTS Steamworks)
endif ()
endif ()
find_package(Qt6Keychain REQUIRED)
add_subdirectory(external)

View file

@ -152,11 +152,6 @@ if (BUILD_FLATPAK)
target_compile_definitions(astra PRIVATE FLATPAK)
endif ()
if (ENABLE_STEAM)
target_link_libraries(astra PRIVATE Steamworks)
target_compile_definitions(astra PRIVATE ENABLE_STEAM)
endif ()
if (ENABLE_GAMEMODE)
target_link_libraries(astra PRIVATE ${GAMEMODE_LIBRARIES})
target_compile_definitions(astra PRIVATE ENABLE_GAMEMODE)

View file

@ -11,7 +11,6 @@ class SteamAPI : public QObject
{
public:
explicit SteamAPI(QObject *parent = nullptr);
~SteamAPI() override;
void setLauncherMode(bool isLauncher);

View file

@ -3,47 +3,23 @@
#include "steamapi.h"
#ifdef ENABLE_STEAM
#include <steam/steam_api.h>
#endif
#include "astra_log.h"
#include "launchercore.h"
SteamAPI::SteamAPI(QObject *parent)
: QObject(parent)
{
#ifdef ENABLE_STEAM
qputenv("SteamAppId", "39210");
qputenv("SteamGameId", "39210");
if (!SteamAPI_Init()) {
qFatal(ASTRA_LOG) << "Failed to initialize steam api!";
}
#endif
}
SteamAPI::~SteamAPI()
{
#ifdef ENABLE_STEAM
SteamAPI_Shutdown();
#endif
// TODO: stub
}
void SteamAPI::setLauncherMode(bool isLauncher)
{
#ifdef ENABLE_STEAM
SteamUtils()->SetGameLauncherMode(isLauncher);
#else
Q_UNUSED(isLauncher)
#endif
// TODO: stub
}
bool SteamAPI::isDeck() const
{
#ifdef ENABLE_STEAM
return SteamUtils()->IsSteamRunningOnSteamDeck();
#else
// TODO: stub
return false;
#endif
}