mirror of
https://github.com/redstrate/Astra.git
synced 2025-06-07 22:47:46 +00:00
Rip out Steamworks integration for now
This commit is contained in:
parent
01e433fe4f
commit
4da74915c9
5 changed files with 4 additions and 47 deletions
|
@ -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:
|
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.
|
* `ENABLE_GAMEMODE`: Gamemode integration, requires Gamemode.
|
||||||
|
|
||||||
To configure, run `cmake` in the source directory:
|
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:
|
This command will create a new build directory and configure the source directory (`.`). If you want to enable more options, pass them now:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cmake -S . -B build -DENABLE_STEAM=ON
|
$ cmake -S . -B build -DENABLE_GAMEMODE=ON
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
|
@ -8,7 +8,6 @@ project(Astra VERSION 0.5.0 LANGUAGES CXX)
|
||||||
option(BUILD_FLATPAK "Build for Flatpak." OFF)
|
option(BUILD_FLATPAK "Build for Flatpak." OFF)
|
||||||
|
|
||||||
# options for features you may want or need
|
# 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)
|
option(ENABLE_GAMEMODE "Build with Feral GameMode support, requires the daemon to be installed." ON)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
@ -53,17 +52,6 @@ if (ENABLE_GAMEMODE)
|
||||||
pkg_search_module(GAMEMODE REQUIRED gamemode)
|
pkg_search_module(GAMEMODE REQUIRED gamemode)
|
||||||
endif ()
|
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)
|
find_package(Qt6Keychain REQUIRED)
|
||||||
|
|
||||||
add_subdirectory(external)
|
add_subdirectory(external)
|
||||||
|
|
|
@ -152,11 +152,6 @@ if (BUILD_FLATPAK)
|
||||||
target_compile_definitions(astra PRIVATE FLATPAK)
|
target_compile_definitions(astra PRIVATE FLATPAK)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (ENABLE_STEAM)
|
|
||||||
target_link_libraries(astra PRIVATE Steamworks)
|
|
||||||
target_compile_definitions(astra PRIVATE ENABLE_STEAM)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (ENABLE_GAMEMODE)
|
if (ENABLE_GAMEMODE)
|
||||||
target_link_libraries(astra PRIVATE ${GAMEMODE_LIBRARIES})
|
target_link_libraries(astra PRIVATE ${GAMEMODE_LIBRARIES})
|
||||||
target_compile_definitions(astra PRIVATE ENABLE_GAMEMODE)
|
target_compile_definitions(astra PRIVATE ENABLE_GAMEMODE)
|
||||||
|
|
|
@ -11,7 +11,6 @@ class SteamAPI : public QObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit SteamAPI(QObject *parent = nullptr);
|
explicit SteamAPI(QObject *parent = nullptr);
|
||||||
~SteamAPI() override;
|
|
||||||
|
|
||||||
void setLauncherMode(bool isLauncher);
|
void setLauncherMode(bool isLauncher);
|
||||||
|
|
||||||
|
|
|
@ -3,47 +3,23 @@
|
||||||
|
|
||||||
#include "steamapi.h"
|
#include "steamapi.h"
|
||||||
|
|
||||||
#ifdef ENABLE_STEAM
|
|
||||||
#include <steam/steam_api.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "astra_log.h"
|
#include "astra_log.h"
|
||||||
#include "launchercore.h"
|
#include "launchercore.h"
|
||||||
|
|
||||||
SteamAPI::SteamAPI(QObject *parent)
|
SteamAPI::SteamAPI(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_STEAM
|
// TODO: stub
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SteamAPI::setLauncherMode(bool isLauncher)
|
void SteamAPI::setLauncherMode(bool isLauncher)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_STEAM
|
|
||||||
SteamUtils()->SetGameLauncherMode(isLauncher);
|
|
||||||
#else
|
|
||||||
Q_UNUSED(isLauncher)
|
Q_UNUSED(isLauncher)
|
||||||
#endif
|
// TODO: stub
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SteamAPI::isDeck() const
|
bool SteamAPI::isDeck() const
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_STEAM
|
// TODO: stub
|
||||||
return SteamUtils()->IsSteamRunningOnSteamDeck();
|
|
||||||
#else
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue