mirror of
https://github.com/acidicoala/SmokeAPI.git
synced 2025-12-05 21:15:39 -05:00
Fix linux build
This commit is contained in:
3
.idea/dictionaries/project.xml
generated
3
.idea/dictionaries/project.xml
generated
@@ -4,6 +4,8 @@
|
|||||||
<w>abcdefghijklmnopqrstuvwxyz</w>
|
<w>abcdefghijklmnopqrstuvwxyz</w>
|
||||||
<w>acidicoala</w>
|
<w>acidicoala</w>
|
||||||
<w>ajaxgetdlclist</w>
|
<w>ajaxgetdlclist</w>
|
||||||
|
<w>dlmopen</w>
|
||||||
|
<w>dlopen</w>
|
||||||
<w>indicies</w>
|
<w>indicies</w>
|
||||||
<w>inlinentd</w>
|
<w>inlinentd</w>
|
||||||
<w>isteamapps</w>
|
<w>isteamapps</w>
|
||||||
@@ -13,6 +15,7 @@
|
|||||||
<w>koalabox</w>
|
<w>koalabox</w>
|
||||||
<w>koality</w>
|
<w>koality</w>
|
||||||
<w>koaloader</w>
|
<w>koaloader</w>
|
||||||
|
<w>libgtk</w>
|
||||||
<w>polyhook</w>
|
<w>polyhook</w>
|
||||||
<w>simplecpp</w>
|
<w>simplecpp</w>
|
||||||
<w>steamapps</w>
|
<w>steamapps</w>
|
||||||
|
|||||||
7
.idea/runConfigurations/exports_generator__32___linux_.xml
generated
Normal file
7
.idea/runConfigurations/exports_generator__32___linux_.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="exports_generator [32] [linux]" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="FALSE libsteam_api_o $ProjectFileDir$/res/steamworks/*/binaries/linux32/libsteam_api.so $CMakeCurrentGenerationDir$/generated/libsteam_api_exports.cpp" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="exports_generator" CONFIG_NAME="Debug [32]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="exports_generator">
|
||||||
|
<method v="2">
|
||||||
|
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="exports_generator [64]" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="FALSE steam_api64_o $ProjectFileDir$/res/steamworks/*/binaries/steam_api64.dll $CMakeCurrentGenerationDir$/generated/linker_exports_for_steam_api.h" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="exports_generator" CONFIG_NAME="Debug [32]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="exports_generator">
|
|
||||||
<method v="2">
|
|
||||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
|
||||||
</method>
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
||||||
7
.idea/runConfigurations/exports_generator__64___win_.xml
generated
Normal file
7
.idea/runConfigurations/exports_generator__64___win_.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="exports_generator [64] [win]" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="FALSE steam_api64_o $ProjectFileDir$/res/steamworks/*/binaries/steam_api64.dll $CMakeCurrentGenerationDir$/generated/linker_exports_for_steam_api.h" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="exports_generator" CONFIG_NAME="Debug [32]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="exports_generator">
|
||||||
|
<method v="2">
|
||||||
|
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
2
.idea/runConfigurations/steamworks_parser.xml
generated
2
.idea/runConfigurations/steamworks_parser.xml
generated
@@ -1,5 +1,5 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="steamworks_parser" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$ProjectFileDir$/res/" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="steamworks_parser" CONFIG_NAME="Debug [32]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="steamworks_parser">
|
<configuration default="false" name="steamworks_parser" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$ProjectFileDir$/res/" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SmokeAPI" TARGET_NAME="steamworks_parser" CONFIG_NAME="Debug [64]" RUN_TARGET_PROJECT_NAME="SmokeAPI" RUN_TARGET_NAME="steamworks_parser">
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||||
</method>
|
</method>
|
||||||
|
|||||||
@@ -86,9 +86,16 @@ target_link_libraries(SmokeAPI_static PUBLIC SmokeAPI::common)
|
|||||||
add_library(SmokeAPI SHARED ${SMOKE_API_SOURCES})
|
add_library(SmokeAPI SHARED ${SMOKE_API_SOURCES})
|
||||||
target_link_libraries(SmokeAPI PUBLIC SmokeAPI::common)
|
target_link_libraries(SmokeAPI PUBLIC SmokeAPI::common)
|
||||||
set_target_properties(SmokeAPI PROPERTIES OUTPUT_NAME ${SMOKE_API_FILENAME})
|
set_target_properties(SmokeAPI PROPERTIES OUTPUT_NAME ${SMOKE_API_FILENAME})
|
||||||
|
|
||||||
configure_include_directories()
|
configure_include_directories()
|
||||||
|
|
||||||
|
## https://github.com/batterycenter/embed
|
||||||
|
target_compile_definitions(SmokeAPI PUBLIC B_PRODUCTION_MODE)
|
||||||
|
CPMAddPackage(
|
||||||
|
URI "gh:batterycenter/embed@1.2.19"
|
||||||
|
OPTIONS "B_PRODUCTION_MODE ON"
|
||||||
|
)
|
||||||
|
b_embed(SmokeAPI "res/interface_lookup.json")
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
configure_version_resource(
|
configure_version_resource(
|
||||||
TARGET SmokeAPI
|
TARGET SmokeAPI
|
||||||
@@ -110,19 +117,11 @@ if(WIN32)
|
|||||||
DLL_FILES_GLOB "C:/Windows/System32/version.dll"
|
DLL_FILES_GLOB "C:/Windows/System32/version.dll"
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
configure_linker_exports(
|
# configure_linker_exports(
|
||||||
TARGET SmokeAPI
|
# TARGET SmokeAPI
|
||||||
HEADER_NAME "libsteam_api_exports.cpp"
|
# HEADER_NAME "libsteam_api_exports.cpp"
|
||||||
FORWARDED_DLL "${STEAM_API_MODULE}_o.so"
|
# FORWARDED_DLL "${STEAM_API_MODULE}_o.so"
|
||||||
DLL_FILES_GLOB "${CMAKE_CURRENT_SOURCE_DIR}/res/steamworks/*/binaries/${LINUX_DIR}/${STEAM_API_MODULE}.so"
|
# DLL_FILES_GLOB "${CMAKE_CURRENT_SOURCE_DIR}/res/steamworks/*/binaries/${LINUX_DIR}/${STEAM_API_MODULE}.so"
|
||||||
INPUT_SOURCES_DIR ""
|
# INPUT_SOURCES_DIR ""
|
||||||
)
|
# )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
## https://github.com/batterycenter/embed
|
|
||||||
target_compile_definitions(SmokeAPI PUBLIC B_PRODUCTION_MODE)
|
|
||||||
CPMAddPackage(
|
|
||||||
URI "gh:batterycenter/embed@1.2.19"
|
|
||||||
OPTIONS "B_PRODUCTION_MODE ON"
|
|
||||||
)
|
|
||||||
b_embed(SmokeAPI "res/interface_lookup.json")
|
|
||||||
|
|||||||
2
KoalaBox
2
KoalaBox
Submodule KoalaBox updated: e38fa5d2b2...dbe840c569
Binary file not shown.
Binary file not shown.
@@ -180,7 +180,12 @@ namespace smoke_api {
|
|||||||
|
|
||||||
AppId_t get_app_id() {
|
AppId_t get_app_id() {
|
||||||
try {
|
try {
|
||||||
const auto app_id_str = kb::util::get_env_var("SteamAppId");
|
const auto* const app_id_str = std::getenv("SteamAppId");
|
||||||
|
if(app_id_str == nullptr) {
|
||||||
|
LOG_WARN("No SteamAppId is set in current environment");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static auto app_id = std::stoi(app_id_str);
|
static auto app_id = std::stoi(app_id_str);
|
||||||
return app_id;
|
return app_id;
|
||||||
} catch(const std::exception& e) {
|
} catch(const std::exception& e) {
|
||||||
|
|||||||
@@ -2,11 +2,15 @@
|
|||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
#include <koalabox/core.hpp>
|
|
||||||
#include <koalabox/hook.hpp>
|
#include <koalabox/hook.hpp>
|
||||||
|
|
||||||
|
#ifdef KB_WIN
|
||||||
#define VIRTUAL(TYPE) __declspec(noinline) TYPE __fastcall // NOLINT(*-macro-parentheses)
|
#define VIRTUAL(TYPE) __declspec(noinline) TYPE __fastcall // NOLINT(*-macro-parentheses)
|
||||||
#define C_DECL(TYPE) extern "C" __declspec(noinline) TYPE __cdecl
|
#define C_DECL(TYPE) extern "C" __declspec(noinline) TYPE __cdecl
|
||||||
|
#elifdef KB_LINUX
|
||||||
|
#define VIRTUAL(TYPE) __attribute__ ((__noinline__)) TYPE
|
||||||
|
#define C_DECL(TYPE) extern "C" __attribute__ ((__noinline__)) TYPE
|
||||||
|
#endif
|
||||||
|
|
||||||
// These macros are meant to be used for callbacks that should return original result
|
// These macros are meant to be used for callbacks that should return original result
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,11 @@ namespace {
|
|||||||
return fs::path();
|
return fs::path();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// TODO: Some older libsteam_api.so binaries have set the `PF_X` flag from `PT_GNU_STACK`.
|
||||||
|
// This prevents us from loading them on modern Linux distros. Hence, we need to
|
||||||
|
// clear it using tools like elfio or libelf.
|
||||||
|
// Affected versions (all 32-bit): 106-107
|
||||||
}
|
}
|
||||||
|
|
||||||
void download_sdk(const fs::path& steamworks_dir, const std::string_view& version) {
|
void download_sdk(const fs::path& steamworks_dir, const std::string_view& version) {
|
||||||
|
|||||||
Reference in New Issue
Block a user