restore upstream repo files inside their dedicated folder + move steamnetworkingsockets to this folder

This commit is contained in:
otavepto 2023-12-27 17:10:09 +02:00
parent 1c0baa99ce
commit 237d7e6672
20 changed files with 1447 additions and 0 deletions

View File

@ -0,0 +1,185 @@
stages:
- dependencies
- build
- deploy
- page_deploy
protobuf_static_steamos:
stage: dependencies
image: tianon/steamos
script:
# don't rebuild every time
- test -e ./protobuf/prefix && exit 0
- apt update && apt -y install gcc-4.9 g++-4.9 git autotools-dev automake libtool g++-4.9-multilib gcc-4.9-multilib build-essential
- export BASE_PREFIX_PATH=$(pwd)
- echo $BASE_PREFIX_PATH
- mkdir deps
- cd deps
- git clone --branch 21.x https://github.com/protocolbuffers/protobuf.git
- cd protobuf
- sh autogen.sh
- ./configure "CC=gcc-4.9 -m32" "CXX=g++-4.9 -m32" CPPFLAGS="-fPIC -Ofast" CXXFLAGS="-fPIC -Ofast" --prefix=$BASE_PREFIX_PATH/protobuf/prefix_x86/ --disable-shared --enable-static
- make -j8 install
- make clean
- ./configure "CC=gcc-4.9" "CXX=g++-4.9" "CPPFLAGS=-fPIC -Ofast" "CXXFLAGS=-fPIC -Ofast" --prefix=$BASE_PREFIX_PATH/protobuf/prefix/ --disable-shared --enable-static
- make -j8 install
cache:
key: protobuf-static-steamos-cache
# policy: push
paths:
- protobuf/
artifacts:
paths:
- protobuf/
expire_in: 1 day
build_steamos:
stage: build
image: tianon/steamos
dependencies:
- protobuf_static_steamos
before_script:
- apt update && apt -y install gcc-4.9 g++-4.9 git libtool g++-4.9-multilib gcc-4.9-multilib
script:
- ls -lah
- uname -a
- sed -i 's/^g++ /g++-4.9 /g' build_steamos.sh
- sed -i 's/..\/protobuf\/prefix/.\/protobuf\/prefix/g' build_steamos.sh
- sh build_steamos.sh
artifacts:
paths:
- linux/
expire_in: 1 day
build_windows:
stage: build
image: fedora:35
script:
- dnf -y install wine wget p7zip sed dos2unix python
- unix2dos *.txt
- unix2dos files_example/*.txt files_example/*/*.txt
- sed -i 's/..\\vcpkg\\installed\\/.\\protobuf_/g' build_set_protobuf_directories.bat
- wget 'https://gitlab.com/Mr_Goldberg/goldberg_emulator/uploads/48db8f434a193aae872279dc4f5dde6a/sdk_standalone.7z'
- wget 'https://gitlab.com/Mr_Goldberg/goldberg_emulator/uploads/0119304e030098b4821d73170fe52084/protobuf_x64-windows-static.7z'
- wget 'https://gitlab.com/Mr_Goldberg/goldberg_emulator/uploads/4185a97ab363ddc1859127e59ec68581/protobuf_x86-windows-static.7z'
- 7za x protobuf_x86-windows-static.7z -oprotobuf_x86-windows-static
- 7za x protobuf_x64-windows-static.7z -oprotobuf_x64-windows-static
- 7za x sdk_standalone.7z -osdk_standalone
- DLL_FILES="$(ls dll/*.cpp | tr "\n" " ")"; sed "s|dll/\*.cpp|$DLL_FILES|g" -i *.bat
- DLL_FILES="$(ls dll/*.proto | tr "\n" " " | sed "s/.proto/.pb.cc/g")"; sed "s|dll/\*.cc|$DLL_FILES|g" -i *.bat
- sed "s| /MP12 | /MP4 |g" -i *.bat
- python generate_build_win_bat.py
- export WINEDEBUG=-all
- wine cmd /c build_win_release_test.bat
artifacts:
paths:
- release/
expire_in: 1 day
build_cmake_linux:
stage: build
image: ubuntu
when: manual
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt update -y
- apt install build-essential cmake libprotobuf-dev protobuf-compiler ninja-build -y
script:
- mkdir cmake-builds && cd cmake-builds
- mkdir x64-release && cd x64-release
- cmake ../../ -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo" && ninja
- cd ..
# - mkdir x64-experimental-release && cd x64-experimental-release
# - cmake ../../ -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo" -DEMU_EXPERIMENTAL_BUILD:BOOL=ON && ninja
# - cd ..
artifacts:
paths:
- cmake-builds/
expire_in: 1 day
build_cmake_windows:
stage: build
image: fedora:29
when: manual
before_script:
- dnf -y install wine wget p7zip sed dos2unix unzip
- wget 'https://gitlab.com/Mr_Goldberg/goldberg_emulator/uploads/48db8f434a193aae872279dc4f5dde6a/sdk_standalone.7z'
- 7za x sdk_standalone.7z -osdk_standalone
- wget 'https://github.com/Kitware/CMake/releases/download/v3.15.0-rc1/cmake-3.15.0-rc1-win64-x64.zip'
- 7za x cmake-3.15.0-rc1-win64-x64.zip
- wget 'https://gitlab.com/Mr_Goldberg/goldberg_emulator/uploads/0119304e030098b4821d73170fe52084/protobuf_x64-windows-static.7z'
- 7za x protobuf_x64-windows-static.7z -oprotobuf_x64-windows-static
script:
- export WINEDEBUG=-all
- wine cmd /c
- mkdir cmake-builds && cd cmake-builds
- mkdir x64-release && cd x64-release
- echo call .\\..\\..\\sdk_standalone\\set_vars64.bat >> cmake-build.bat
- echo .\\..\\..\\cmake-3.15.0-rc1-win64-x64\\bin\\cmake.exe ..\\.. -G \"NMake Makefiles\" -DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo" -DCMAKE_PREFIX_PATH="protobuf_x64-windows-static" -DProtobuf_PROTOC_EXECUTABLE:STRING="./../../protobuf_x64-windows-static/tools/protobuf/protoc.exe" >> cmake-build.bat
- echo nmake.exe >> cmake-build.bat
- wine cmd /c cmake-build.bat
- cd ..
- mkdir x64-experimental-release && cd x64-experimental-release
- echo call .\\..\\..\\sdk_standalone\\set_vars64.bat >> cmake-build.bat
- echo .\\..\\..\\cmake-3.15.0-rc1-win64-x64\\bin\\cmake.exe ..\\.. -G \"NMake Makefiles\" -DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo" -DEMU_EXPERIMENTAL_BUILD=ON -DEMU_OVERLAY=ON -DCMAKE_PREFIX_PATH="protobuf_x64-windows-static" -DProtobuf_PROTOC_EXECUTABLE:STRING="./../../protobuf_x64-windows-static/tools/protobuf/protoc.exe" >> cmake-build.bat
- echo nmake.exe >> cmake-build.bat
- wine cmd /c cmake-build.bat
- cd ..
artifacts:
paths:
- cmake-builds/
expire_in: 1 day
deploy_all:
stage: deploy
image: fedora
dependencies:
- build_windows
- build_steamos
script:
- ls -lah
- dnf -y install git tree
- mkdir -p release/source_code
- git bundle create release/source_code/source_code.bundle --all
- "echo \"This is a git bundle of the full repo, to use: git clone source_code.bundle --branch master\" > release/source_code/Readme.txt"
- mv linux release/
- shopt -s extglob
- rm -rf .g*
- rm -rf !(release)
- mv release/* ./
- rm -rf release
- echo $CI_JOB_ID > job_id
- tree
artifacts:
name: "Goldberg_Lan_Steam_Emu_$CI_COMMIT_REF_NAME-$CI_COMMIT_TAG-$CI_COMMIT_SHORT_SHA"
paths:
- ./
expire_in: never
pages:
image: fedora
stage: page_deploy
dependencies:
- deploy_all
script:
- DEPLOY_ALL_JOBID=$(cat job_id)
- mkdir public
- cat website/template.html | sed 's|X_LATEST_BUILD_URL_X|https://gitlab.com/Mr_Goldberg/goldberg_emulator/-/jobs/'$DEPLOY_ALL_JOBID'/artifacts/download|g' > public/index.html
- sed -i 's|X_LATEST_BUILD_COMMIT_HASH_X|'$CI_COMMIT_SHA'|g' public/index.html
artifacts:
paths:
- public/
only:
- master

View File

@ -0,0 +1,331 @@
# Based on: https://github.com/ttroy50/cmake-examples/blob/master/03-code-generation/protobuf/CMakeLists.txt
cmake_minimum_required(VERSION 3.6)
# Set the project name
project(goldberg_emulator)
if(MSVC)
# Set static environment (results in static compile flags) if Visual Studio is used (dynamic by default)
# Officially recommended solution: https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-can-i-build-my-msvc-application-with-a-static-runtime
# Should be replaced by a better solution in the future: https://gitlab.kitware.com/cmake/cmake/merge_requests/3211
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
# Disable MSVC++ warning C4996: 'may be unsafe/disable deprecation'
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
# Add option to enable experimental build
option(EMU_EXPERIMENTAL_BUILD "Enable experimental build" OFF)
# Set CXX standard
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Find the protobuf compiler and libraries
include(FindProtobuf)
find_package(Protobuf 3.1.0 REQUIRED)
# Generate the .h and .cxx files for dll/net.proto
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS dll/net.proto)
# Print path to generated files
message(STATUS "PROTO_SRCS = ${PROTO_SRCS}")
message(STATUS "PROTO_HDRS = ${PROTO_HDRS}")
message(STATUS "PROTOBUF_INCLUDE_DIRS = ${PROTOBUF_INCLUDE_DIRS}")
message(STATUS "PROTOBUF_LIBRARIES = ${PROTOBUF_LIBRARIES}")
message(STATUS "PROTOBUF_PROTOC_EXECUTABLE = ${PROTOBUF_PROTOC_EXECUTABLE}")
# Setup the lib/exe names for the targets
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(LIB_STEAM_API steam_api64)
set(LIB_STEAMCLIENT steamclient64)
set(LIB_STEAMNETWORKINGSOCKETS steamnetworkingsockets64)
set(BIN_LOBBY_CONNECT lobby_connect64)
set(BIN_GENERATE_INTERFACES_FILE generate_interfaces_file64)
else()
set(LIB_STEAM_API steam_api)
set(LIB_STEAMCLIENT steamclient)
set(LIB_STEAMNETWORKINGSOCKETS steamnetworkingsockets)
set(BIN_LOBBY_CONNECT lobby_connect)
set(BIN_GENERATE_INTERFACES_FILE generate_interfaces_file)
endif()
elseif(UNIX AND NOT APPLE)
set(LIB_STEAM_API steam_api)
set(LIB_STEAMCLIENT steamclient)
set(LIB_STEAMNETWORKINGSOCKETS steamnetworkingsockets)
set(BIN_LOBBY_CONNECT lobby_connect)
set(BIN_GENERATE_INTERFACES_FILE generate_interfaces_file)
else()
message(FATAL_ERROR "Other platforms not supported...")
endif()
# Gather the files that are shared between multiple targets
file(GLOB DLL_SRC_SHARED
dll/*.h
dll/*.cpp
)
file(GLOB DETOURS_SRC_SHARED
detours/*.cpp
)
if(WIN32)
file(GLOB OVERLAY_EXPERIMENTAL_SRC_SHARED
overlay_experimental/*.cpp
overlay_experimental/windows/*.cpp
ImGui/*.cpp
ImGui/impls/*.cpp
ImGui/impls/windows/*.cpp
glew/glew.c
)
elseif(UNIX)
file(GLOB OVERLAY_EXPERIMENTAL_SRC_SHARED
overlay_experimental/*.cpp
overlay_experimental/linux/*.cpp
ImGui/*.cpp
ImGui/impls/*.cpp
ImGui/impls/linux/*.cpp
glew/glew.c
)
endif()
###################################################
# Setup for the steam_api(64).dll / libsteam_api.so
###################################################
# Setup the target
add_library(${LIB_STEAM_API}
SHARED
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${DETOURS_SRC_SHARED}>
$<$<AND:$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:${OVERLAY_EXPERIMENTAL_SRC_SHARED}>
${DLL_SRC_SHARED}
${PROTO_SRCS}
${PROTO_HDRS}
)
# Include the required directories
target_include_directories(${LIB_STEAM_API}
PRIVATE
${PROTOBUF_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/ImGui
${CMAKE_CURRENT_SOURCE_DIR}/glew/include
)
# Link the required libraries
target_link_libraries(${LIB_STEAM_API}
PRIVATE
protobuf::libprotobuf
$<$<BOOL:${WIN32}>:ws2_32>
$<$<BOOL:${WIN32}>:iphlpapi>
$<$<AND:$<BOOL:${WIN32}>,$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:opengl32.lib>
$<$<AND:$<BOOL:${WIN32}>,$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:Winmm.lib>
)
# Add target compile definitions
target_compile_definitions(${LIB_STEAM_API}
PRIVATE
$<$<CONFIG:>:EMU_RELEASE_BUILD>
$<$<CONFIG:Release>:EMU_RELEASE_BUILD>
$<$<CONFIG:RelWithDebInfo>:EMU_RELEASE_BUILD>
$<$<CONFIG:MinSizeRel>:EMU_RELEASE_BUILD>
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:EMU_EXPERIMENTAL_BUILD>
$<$<BOOL:${EMU_OVERLAY}>:EMU_OVERLAY>
$<$<AND:$<BOOL:${WIN32}>,$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:GLEW_STATIC>
)
# Install the target
if(WIN32)
install(TARGETS
${LIB_STEAM_API}
RUNTIME DESTINATION ./
)
else()
install(TARGETS
${LIB_STEAM_API}
LIBRARY DESTINATION ./
)
endif()
########################################################
# Setup for the steamclient(64).dll / libsteamclient.so?
########################################################
# Setup the target
add_library(${LIB_STEAMCLIENT}
SHARED
steamclient.cpp
)
# Add target compile definitions
target_compile_definitions(${LIB_STEAMCLIENT}
PRIVATE
$<$<CONFIG:>:EMU_RELEASE_BUILD>
$<$<CONFIG:Release>:EMU_RELEASE_BUILD>
$<$<CONFIG:RelWithDebInfo>:EMU_RELEASE_BUILD>
$<$<CONFIG:MinSizeRel>:EMU_RELEASE_BUILD>
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:EMU_EXPERIMENTAL_BUILD>
)
# Install the target
if(WIN32)
install(TARGETS
${LIB_STEAMCLIENT}
RUNTIME DESTINATION ./
)
else()
install(TARGETS
${LIB_STEAMCLIENT}
LIBRARY DESTINATION ./
)
endif()
if(NOT WIN32)
message(STATUS "Target library 'steamclient' is only suported for windows at this time... Disabling Build ALL inclusion for this target")
set_target_properties(${LIB_STEAMCLIENT} PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
endif()
##############################################################################
# Setup for the steamnetworkingsockets(64).dll / libsteamnetworkingsockets.so?
##############################################################################
# Setup the target
add_library(${LIB_STEAMNETWORKINGSOCKETS}
SHARED
steamnetworkingsockets.cpp
)
# Add target compile definitions
target_compile_definitions(${LIB_STEAMNETWORKINGSOCKETS}
PRIVATE
$<$<CONFIG:>:EMU_RELEASE_BUILD>
$<$<CONFIG:Release>:EMU_RELEASE_BUILD>
$<$<CONFIG:RelWithDebInfo>:EMU_RELEASE_BUILD>
$<$<CONFIG:MinSizeRel>:EMU_RELEASE_BUILD>
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:EMU_EXPERIMENTAL_BUILD>
)
# Setup install rules for the target
if(WIN32)
install(TARGETS
${LIB_STEAMNETWORKINGSOCKETS}
RUNTIME DESTINATION ./
)
else()
install(TARGETS
${LIB_STEAMNETWORKINGSOCKETS}
LIBRARY DESTINATION ./
)
endif()
if(NOT WIN32)
message(STATUS "Target library 'steamnetworkingsockets' is only supported for windows at this time... Disabling Build ALL inclusion for this target")
set_target_properties(${LIB_STEAMNETWORKINGSOCKETS} PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
endif()
###########################################################################
# Setup for the lobby_connect(64).exe / lobby_connect
###########################################################################
# Setup the target
add_executable(${BIN_LOBBY_CONNECT}
lobby_connect.cpp
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${DETOURS_SRC_SHARED}>
${DLL_SRC_SHARED}
${PROTO_SRCS}
${PROTO_HDRS}
)
target_include_directories(${BIN_LOBBY_CONNECT}
PRIVATE
${PROTOBUF_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
)
# Link the required libraries
target_link_libraries(${BIN_LOBBY_CONNECT}
PRIVATE
protobuf::libprotobuf
$<$<BOOL:${WIN32}>:ws2_32>
$<$<BOOL:${WIN32}>:iphlpapi>
$<$<BOOL:${WIN32}>:comdlg32>
${CMAKE_DL_LIBS}
-debug:none
)
# Add target compile definitions
target_compile_definitions(${BIN_LOBBY_CONNECT}
PRIVATE
NO_DISK_WRITES
LOBBY_CONNECT
$<$<CONFIG:>:EMU_RELEASE_BUILD>
$<$<CONFIG:Release>:EMU_RELEASE_BUILD>
$<$<CONFIG:RelWithDebInfo>:EMU_RELEASE_BUILD>
$<$<CONFIG:MinSizeRel>:EMU_RELEASE_BUILD>
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:EMU_EXPERIMENTAL_BUILD>
)
# Setup install rules for the target
install(TARGETS
${BIN_LOBBY_CONNECT}
RUNTIME DESTINATION lobby_connect/
)
###########################################################################
# Setup for the generate_interfaces_file(64).exe / generate_interfaces_file
###########################################################################
# Setup the target
add_executable(${BIN_GENERATE_INTERFACES_FILE}
generate_interfaces_file.cpp
)
# Link the required libraries
target_link_libraries(${BIN_GENERATE_INTERFACES_FILE}
PRIVATE
-debug:none
)
# Setup install rules for the target
install(TARGETS
${BIN_GENERATE_INTERFACES_FILE}
RUNTIME DESTINATION tools/
)
###########################################################################
# Installation setup for non target files and directories
###########################################################################
install(FILES
Readme_lobby_connect.txt
DESTINATION lobby_connect/
)
install(FILES
scripts/find_interfaces.sh
scripts/find_interfaces.ps1
Readme_generate_interfaces.txt
DESTINATION tools/
)
install(FILES
Readme_release.txt
files_example/steam_appid.EDIT_AND_RENAME.txt
files_example/steam_interfaces.EXAMPLE.txt
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${PROJECT_SOURCE_DIR}/Readme_experimental.txt>
$<$<CONFIG:Debug>:${PROJECT_SOURCE_DIR}/Readme_debug.txt>
DESTINATION ./
)
install(DIRECTORY
files_example/steam_settings.EXAMPLE
DESTINATION ./
)

View File

@ -0,0 +1,520 @@
{
"configurations": [
{
"name": "Windows-x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": [
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "x64-windows-static",
"type": "STRING"
}
],
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "Windows-x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "x64-windows-static",
"type": "STRING"
}
],
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "Windows-x86-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x86" ],
"variables": [
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "x86-windows-static",
"type": "STRING"
}
],
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "Windows-x86-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x86" ],
"variables": [
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "x86-windows-static",
"type": "STRING"
}
],
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "Linux-x64-Release",
"generator": "Unix Makefiles",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/local/bin/cmake",
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ],
"remoteMachineName": "${defaultRemoteMachineName}",
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": true,
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": true,
"remoteCopySourcesMethod": "rsync",
"variables": []
},
{
"name": "Linux-x64-Debug",
"generator": "Unix Makefiles",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/local/bin/cmake",
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ],
"remoteMachineName": "${defaultRemoteMachineName}",
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": true,
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": true,
"remoteCopySourcesMethod": "rsync",
"variables": []
},
{
"name": "Linux-x86-Release",
"generator": "Unix Makefiles",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/local/bin/cmake",
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x86" ],
"remoteMachineName": "${defaultRemoteMachineName}",
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": true,
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": true,
"remoteCopySourcesMethod": "rsync",
"variables": []
},
{
"name": "Linux-x86-Debug",
"generator": "Unix Makefiles",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/local/bin/cmake",
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x86" ],
"remoteMachineName": "${defaultRemoteMachineName}",
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": true,
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": true,
"remoteCopySourcesMethod": "rsync",
"variables": []
},
{
"name": "Windows-x64-ExperimentalRelease",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": [
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "x64-windows-static",
"type": "STRING"
},
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "true",
"type": "STRING"
}
],
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "Windows-x64-ExperimentalDebug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "x64-windows-static",
"type": "STRING"
},
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "true",
"type": "STRING"
}
]
},
{
"name": "Windows-x86-ExperimentalRelease",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake",
"inheritEnvironments": [ "msvc_x86" ],
"variables": [
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "x86-windows-static",
"type": "STRING"
},
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "true",
"type": "STRING"
}
]
},
{
"name": "Windows-x86-ExperimentalDebug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake",
"inheritEnvironments": [ "msvc_x86" ],
"variables": [
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "x86-windows-static",
"type": "STRING"
},
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "true",
"type": "STRING"
}
]
},
{
"name": "Linux-x64-ExperimentalRelease",
"generator": "Unix Makefiles",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/local/bin/cmake",
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ],
"variables": [
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "true",
"type": "STRING"
}
],
"remoteMachineName": "${defaultRemoteMachineName}",
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": true,
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": true,
"remoteCopySourcesMethod": "rsync"
},
{
"name": "Linux-x64-ExperimentalDebug",
"generator": "Unix Makefiles",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/local/bin/cmake",
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ],
"variables": [
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "true",
"type": "STRING"
}
],
"remoteMachineName": "${defaultRemoteMachineName}",
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": true,
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": true,
"remoteCopySourcesMethod": "rsync"
},
{
"name": "Linux-x86-ExperimentalRelease",
"generator": "Unix Makefiles",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/local/bin/cmake",
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x86" ],
"variables": [
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "true",
"type": "STRING"
}
],
"remoteMachineName": "${defaultRemoteMachineName}",
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": true,
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": true,
"remoteCopySourcesMethod": "rsync"
},
{
"name": "Linux-x86-ExperimentalDebug",
"generator": "Unix Makefiles",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/local/bin/cmake",
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x86" ],
"variables": [
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "true",
"type": "STRING"
}
],
"remoteMachineName": "${defaultRemoteMachineName}",
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": true,
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": true,
"remoteCopySourcesMethod": "rsync"
},
{
"name": "WSL-x64-Release",
"generator": "Unix Makefiles",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/bin/cmake",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ],
"wslPath": "${defaultWSLPath}",
"addressSanitizerRuntimeFlags": "detect_leaks=0",
"variables": []
},
{
"name": "WSL-x64-Debug",
"generator": "Unix Makefiles",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/bin/cmake",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ],
"wslPath": "${defaultWSLPath}",
"addressSanitizerRuntimeFlags": "detect_leaks=0",
"variables": []
},
{
"name": "WSL-x86-Release",
"generator": "Unix Makefiles",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/bin/cmake",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x86" ],
"wslPath": "${defaultWSLPath}",
"addressSanitizerRuntimeFlags": "detect_leaks=0",
"variables": []
},
{
"name": "WSL-x86-Debug",
"generator": "Unix Makefiles",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/bin/cmake",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x86" ],
"wslPath": "${defaultWSLPath}",
"addressSanitizerRuntimeFlags": "detect_leaks=0",
"variables": []
},
{
"name": "WSL-x64-ExperimentalRelease",
"generator": "Unix Makefiles",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/bin/cmake",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ],
"wslPath": "${defaultWSLPath}",
"addressSanitizerRuntimeFlags": "detect_leaks=0",
"variables": [
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "True",
"type": "BOOL"
}
]
},
{
"name": "WSL-x64-ExperimentalDebug",
"generator": "Unix Makefiles",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/bin/cmake",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ],
"wslPath": "${defaultWSLPath}",
"addressSanitizerRuntimeFlags": "detect_leaks=0",
"variables": [
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "True",
"type": "BOOL"
}
]
},
{
"name": "WSL-x86-ExperimentalRelease",
"generator": "Unix Makefiles",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/bin/cmake",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x86" ],
"wslPath": "${defaultWSLPath}",
"addressSanitizerRuntimeFlags": "detect_leaks=0",
"variables": [
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "True",
"type": "BOOL"
}
]
},
{
"name": "WSL-x86-ExperimentalDebug",
"generator": "Unix Makefiles",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "/usr/bin/cmake",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x86" ],
"wslPath": "${defaultWSLPath}",
"addressSanitizerRuntimeFlags": "detect_leaks=0",
"variables": [
{
"name": "EMU_EXPERIMENTAL_BUILD",
"value": "True",
"type": "BOOL"
}
]
}
]
}

View File

@ -0,0 +1,50 @@
.DEFAULT_GOAL := all
CXX=clang++
CXX_FLAGS += -fPIC -std=c++14
LD_FLAGS += -shared -lprotobuf-lite -ldl -Wl,--no-undefined
LIBRARY_NAME=libsteam_api.so
RM = rm -f
PROTOS := $(wildcard dll/*.proto)
PROTO_CC := $(PROTOS:.proto=.pb.cc)
PROTO_OBJ := $(PROTOS:.proto=.pb.o)
PROTO_HEADERS := $(PROTOS:.proto=.pb.h)
HEADERS := $(wildcard dll/*.h) $(PROTO_HEADERS)
SRC_NOPROTO := $(wildcard dll/*.cpp)
SRC := $(SRC_NOPROTO) $(PROTO_CC)
OBJ_NOPROTO := $(SRC_NOPROTO:.cpp=.o)
OBJ := $(OBJ_NOPROTO) $(PROTO_OBJ)
$(PROTO_CC) : $(PROTOS)
$(PROTO_HEADERS) : $(PROTO_CC)
$(OBJ_NOPROTO) : $(PROTO_CC) $(PROTO_HEADERS)
$(OBJ) : $(HEADERS)
release: CXX_FLAGS += -DNDEBUG -DEMU_RELEASE_BUILD -Ofast
release: LD_FLAGS += -lpthread
release32: CXX_FLAGS += -m32
release32: LD_FLAGS += -m32
debug: CXX_FLAGS += -g3 -fsanitize=address
debug: LD_FLAGS += -lasan
release: library
release32: release
debug: library
all: release
library: $(LIBRARY_NAME)
$(PROTO_CC) :
protoc -I./dll/ --cpp_out=./dll/ ./dll/*.proto
$(PROTO_OBJ) : %.o : %.cc
$(CXX) $(CXX_FLAGS) -c -o $@ $<
$(OBJ_NOPROTO) : %.o : %.cpp
$(CXX) $(CXX_FLAGS) -c -o $@ $<
$(LIBRARY_NAME): $(OBJ)
$(CXX) $(CXX_FLAGS) -o $@ $^ $(LD_FLAGS)
clean:
$(RM) $(OBJ) $(LIBRARY_NAME) $(PROTO_CC) $(PROTOS:.proto=.pb.h)

View File

@ -0,0 +1,47 @@
@echo off
cd /d "%~dp0"
rem Put in the base path in which Visual Studio is installed, default would be C:\Program Files (x86)
set VS_Base_Path=C:\Program Files (x86)
if exist "%VS_Base_Path%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" goto vs2019
if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" goto vs2017
if exist "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" goto vs14
if exist "%VS_Base_Path%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto vs2019_bt
if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto vs2017_bt
if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" goto vs2022
if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto vs2022_bt
if exist ".\sdk_standalone\set_vars64.bat" goto gitlabci
:vs2022
call "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
goto batend
:vs2019
call "%VS_Base_Path%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
goto batend
:vs2017
call "%VS_Base_Path%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
goto batend
:vs14
call "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
goto batend
:vs2022_bt
call "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
goto batend
:vs2019_bt
call "%VS_Base_Path%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
goto batend
:vs2017_bt
call "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
goto batend
:gitlabci
call ".\sdk_standalone\set_vars64.bat"
goto batend
:batend

View File

@ -0,0 +1,48 @@
@echo off
cd /d "%~dp0"
rem Put in the base path in which Visual Studio is installed, default would be C:\Program Files (x86)
set VS_Base_Path=C:\Program Files (x86)
if exist "%VS_Base_Path%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" goto vs2019
if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" goto vs2017
if exist "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat" goto vs14
if exist "%VS_Base_Path%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto vs2019_bt
if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto vs2017_bt
if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" goto vs2022
if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto vs2022_bt
if exist ".\sdk_standalone\set_vars32.bat" goto gitlabci
:vs2022
call "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat"
goto batend
:vs2019
call "%VS_Base_Path%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
goto batend
:vs2017
call "%VS_Base_Path%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
goto batend
:vs14
call "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat"
goto batend
:vs2022_bt
call "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars32.bat"
goto batend
:vs2019_bt
call "%VS_Base_Path%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars32.bat"
goto batend
:vs2017_bt
call "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat"
goto batend
:gitlabci
call ".\sdk_standalone\set_vars32.bat"
goto batend
:batend

View File

@ -0,0 +1,2 @@
protoc -I./dll/ --cpp_out=./dll/ ./dll/*.proto
clang++ -shared -fPIC -o libsteam_api.so dll/*.cpp dll/*.cc -g3 -Wno-return-type -fsanitize=address -lasan -lprotobuf-lite -std=c++14 && echo built

View File

@ -0,0 +1,20 @@
@echo off
cd /d "%~dp0"
SET PROTOBUF_X86_DIRECTORY=..\vcpkg\installed\x86-windows-static
SET PROTOBUF_X64_DIRECTORY=..\vcpkg\installed\x64-windows-static
rem location of protoc in protobuf directories:
SET PROTOC_X86_EXE=%PROTOBUF_X86_DIRECTORY%\tools\protobuf\protoc.exe
SET PROTOC_X64_EXE=%PROTOBUF_X64_DIRECTORY%\tools\protobuf\protoc.exe
if exist "%PROTOBUF_X86_DIRECTORY%\lib\libprotobuf-lite.lib" (
SET PROTOBUF_X86_LIBRARY=%PROTOBUF_X86_DIRECTORY%\lib\libprotobuf-lite.lib
) else (
SET PROTOBUF_X86_LIBRARY=%PROTOBUF_X86_DIRECTORY%\lib\libprotobuf.lib
)
if exist "%PROTOBUF_X64_DIRECTORY%\lib\libprotobuf-lite.lib" (
SET PROTOBUF_X64_LIBRARY=%PROTOBUF_X64_DIRECTORY%\lib\libprotobuf-lite.lib
) else (
SET PROTOBUF_X64_LIBRARY=%PROTOBUF_X64_DIRECTORY%\lib\libprotobuf.lib
)

View File

@ -0,0 +1,16 @@
set -e
rm -rf linux
mkdir -p linux/x86
mkdir -p linux/x86_64
mkdir -p linux/lobby_connect
mkdir -p linux/tools
cp scripts/find_interfaces.sh linux/tools/
cp scripts/steamclient_loader.sh linux/tools/
../protobuf/prefix_x86/bin/protoc -I./dll/ --cpp_out=./dll/ ./dll/*.proto
g++ -m32 -shared -fPIC -fvisibility=hidden -Wl,--exclude-libs,ALL -DGNUC -DEMU_RELEASE_BUILD -DNDEBUG -DCONTROLLER_SUPPORT -s -o linux/x86/libsteam_api.so dll/*.cpp dll/*.cc controller/*.c -Wno-return-type -I../protobuf/prefix_x86/include/ -L../protobuf/prefix_x86/lib/ -lprotobuf-lite -lpthread -ldl -std=c++14 && echo built32
g++ -m32 -fvisibility=hidden -Wl,--exclude-libs,ALL -DGNUC -DEMU_RELEASE_BUILD -DNDEBUG -DNO_DISK_WRITES -DLOBBY_CONNECT -s -o linux/lobby_connect/lobby_connect_x86 lobby_connect.cpp dll/*.cpp dll/*.cc -Wno-return-type -I../protobuf/prefix_x86/include/ -L../protobuf/prefix_x86/lib/ -lprotobuf-lite -lpthread -ldl -std=c++14 && echo built_lobby_connect32
g++ -m32 -shared -fPIC -fvisibility=hidden -Wl,--exclude-libs,ALL -DGNUC -DEMU_RELEASE_BUILD -DSTEAMCLIENT_DLL -DNDEBUG -DCONTROLLER_SUPPORT -s -o linux/x86/steamclient.so dll/*.cpp dll/*.cc controller/*.c -Wno-return-type -I../protobuf/prefix_x86/include/ -L../protobuf/prefix_x86/lib/ -lprotobuf-lite -lpthread -ldl -std=c++14 && echo built32_steamclient
../protobuf/prefix/bin/protoc -I./dll/ --cpp_out=./dll/ ./dll/*.proto
g++ -shared -fPIC -fvisibility=hidden -Wl,--exclude-libs,ALL -DGNUC -DEMU_RELEASE_BUILD -DNDEBUG -DCONTROLLER_SUPPORT -s -o linux/x86_64/libsteam_api.so dll/*.cpp dll/*.cc controller/*.c -Wno-return-type -I../protobuf/prefix/include/ -L../protobuf/prefix/lib/ -lprotobuf-lite -lpthread -ldl -std=c++14 && echo built64
g++ -fvisibility=hidden -Wl,--exclude-libs,ALL -DGNUC -DEMU_RELEASE_BUILD -DNDEBUG -DNO_DISK_WRITES -DLOBBY_CONNECT -s -o linux/lobby_connect/lobby_connect_x64 lobby_connect.cpp dll/*.cpp dll/*.cc -Wno-return-type -I../protobuf/prefix/include/ -L../protobuf/prefix/lib/ -lprotobuf-lite -lpthread -ldl -std=c++14 && echo built_lobby_connect64
g++ -shared -fPIC -fvisibility=hidden -Wl,--exclude-libs,ALL -DGNUC -DEMU_RELEASE_BUILD -DSTEAMCLIENT_DLL -DNDEBUG -DCONTROLLER_SUPPORT -s -o linux/x86_64/steamclient.so dll/*.cpp dll/*.cc controller/*.c -Wno-return-type -I../protobuf/prefix/include/ -L../protobuf/prefix/lib/ -lprotobuf-lite -lpthread -ldl -std=c++14 && echo built64_steamclient

View File

@ -0,0 +1,14 @@
@echo off
cd /d "%~dp0"
call build_set_protobuf_directories.bat
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /Z7 /LD /IImGui /I%PROTOBUF_X86_DIRECTORY%\include\ /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /link /OUT:steam_api.dll
cl /LD steamclient.cpp /EHsc /MP12 /link /OUT:steamclient.dll
"%PROTOC_X64_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /Z7 /LD /IImGui /I%PROTOBUF_X64_DIRECTORY%\include\ /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /link /OUT:steam_api64.dll
cl /LD steamclient.cpp /EHsc /MP12 /link /OUT:steamclient64.dll

View File

@ -0,0 +1,9 @@
cd /d "%~dp0"
call build_set_protobuf_directories.bat
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /IImGui /I%PROTOBUF_X86_DIRECTORY%\include\ /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_EXPERIMENTAL_BUILD /DEMU_OVERLAY /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /link /OUT:steamclient.dll
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /IImGui /I%PROTOBUF_X64_DIRECTORY%\include\ /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_EXPERIMENTAL_BUILD /DEMU_OVERLAY /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /link /OUT:steamclient64.dll

View File

@ -0,0 +1,9 @@
@echo off
cd /d "%~dp0"
mkdir release\tools
del /Q release\tools\*
call build_env_x86.bat
cl generate_interfaces_file.cpp /EHsc /MP12 /Ox /link /debug:none /OUT:release\tools\generate_interfaces_file.exe
del /Q /S release\tools\*.lib
del /Q /S release\tools\*.exp
copy Readme_generate_interfaces.txt release\tools\Readme_generate_interfaces.txt

View File

@ -0,0 +1,12 @@
@echo off
cd /d "%~dp0"
mkdir release\lobby_connect
del /Q release\lobby_connect\*
call build_set_protobuf_directories.bat
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /DNO_DISK_WRITES /DLOBBY_CONNECT /DEMU_RELEASE_BUILD /DNDEBUG /I%PROTOBUF_X86_DIRECTORY%\include\ lobby_connect.cpp dll/*.cpp dll/*.cc "%PROTOBUF_X86_LIBRARY%" Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Comdlg32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\lobby_connect\lobby_connect.exe
del /Q /S release\lobby_connect\*.lib
del /Q /S release\lobby_connect\*.exp
copy Readme_lobby_connect.txt release\lobby_connect\Readme.txt

View File

@ -0,0 +1,24 @@
@echo off
cd /d "%~dp0"
del /Q /S release\*
rmdir /S /Q release\experimental
rmdir /S /Q release\experimental_steamclient
rmdir /S /Q release\lobby_connect
rmdir /S /Q release
mkdir release
call build_set_protobuf_directories.bat
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DNDEBUG /I%PROTOBUF_X86_DIRECTORY%\include\ dll/*.cpp dll/*.cc "%PROTOBUF_X86_LIBRARY%" Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\steam_api.dll
"%PROTOC_X64_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DNDEBUG /I%PROTOBUF_X64_DIRECTORY%\include\ dll/*.cpp dll/*.cc "%PROTOBUF_X64_LIBRARY%" Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\steam_api64.dll
copy Readme_release.txt release\Readme.txt
xcopy /s files_example\* release\
call build_win_release_experimental.bat
call build_win_release_experimental_steamclient.bat
call build_win_lobby_connect.bat
call build_win_find_interfaces.bat

View File

@ -0,0 +1,17 @@
@echo off
cd /d "%~dp0"
mkdir release\experimental
del /Q release\experimental\*
call build_set_protobuf_directories.bat
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DNDEBUG /IImGui /I%PROTOBUF_X86_DIRECTORY%\include\ /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\experimental\steam_api.dll
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DNDEBUG steamclient.cpp /EHsc /MP4 /Ox /link /OUT:release\experimental\steamclient.dll
"%PROTOC_X64_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DNDEBUG /IImGui /I%PROTOBUF_X64_DIRECTORY%\include\ /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\experimental\steam_api64.dll
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DNDEBUG steamclient.cpp /EHsc /MP4 /Ox /link /OUT:release\experimental\steamclient64.dll
copy Readme_experimental.txt release\experimental\Readme.txt

View File

@ -0,0 +1,16 @@
@echo off
cd /d "%~dp0"
mkdir release\experimental_steamclient
del /Q release\experimental_steamclient\*
call build_set_protobuf_directories.bat
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_OVERLAY /IImGui /DNDEBUG /I%PROTOBUF_X86_DIRECTORY%\include\ /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\experimental_steamclient\steamclient.dll
"%PROTOC_X64_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
cl steamclient_loader/*.cpp advapi32.lib user32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\experimental_steamclient\steamclient_loader.exe
copy steamclient_loader\ColdClientLoader.ini release\experimental_steamclient\
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_OVERLAY /IImGui /DNDEBUG /I%PROTOBUF_X64_DIRECTORY%\include\ /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\experimental_steamclient\steamclient64.dll
copy Readme_experimental_steamclient.txt release\experimental_steamclient\Readme.txt

View File

View File

@ -0,0 +1,127 @@
import os
def files_from_dir(dir, extension, filter=[]):
out = []
for f in os.listdir(dir):
if f.endswith(extension) and f not in filter:
out.append(os.path.join(dir, f))
return out
def convert_to_obj(files, obj_dir):
out = []
for f in files:
out.append(os.path.join(obj_dir, os.path.splitext(os.path.basename(f))[0] + ".obj"))
return out
def cl_line_obj(arguments, out_dir):
return "rmdir /S /Q {0}\nmkdir {0}\ncl /Fo:{0}/ /c {1}\n".format(out_dir, ' '.join(arguments))
def cl_line_link(arguments, linker_arguments):
return "cl /LD {} /link {}\n".format(' '.join(arguments), ' '.join(linker_arguments))
def cl_line_exe(arguments, linker_arguments):
return "cl {} /link {}\n".format(' '.join(arguments), ' '.join(linker_arguments))
jobs = 4
normal_build_args = ["/EHsc", "/Ox", "/MP{}".format(jobs)]
includes = ["ImGui", "overlay_experimental"]
includes_32 = list(map(lambda a: '/I{}'.format(a), ["%PROTOBUF_X86_DIRECTORY%\\include\\"] + includes))
includes_64 = list(map(lambda a: '/I{}'.format(a), ["%PROTOBUF_X64_DIRECTORY%\\include\\"] + includes))
debug_build_args = []
release_build_args = ["/DEMU_RELEASE_BUILD", "/DNDEBUG"]
steamclient_build_args = ["/DSTEAMCLIENT_DLL"]
experimental_build_args = ["/DEMU_EXPERIMENTAL_BUILD", "/DCONTROLLER_SUPPORT", "/DEMU_OVERLAY"]
steamclient_experimental_build_args = experimental_build_args + steamclient_build_args
normal_linker_libs = ["Iphlpapi.lib", "Ws2_32.lib", "rtlgenrandom.lib", "Shell32.lib"]
experimental_linker_libs = ["opengl32.lib", "Winmm.lib"] + normal_linker_libs
linker_32 = ['"%PROTOBUF_X86_LIBRARY%"']
linker_64 = ['"%PROTOBUF_X64_LIBRARY%"']
controller_deps = ["controller/gamepad.c"]
imgui_deps = files_from_dir("ImGui", ".cpp") + ["ImGui/backends/imgui_impl_dx9.cpp", "ImGui/backends/imgui_impl_dx10.cpp", "ImGui/backends/imgui_impl_dx11.cpp", "ImGui/backends/imgui_impl_dx12.cpp", "ImGui/backends/imgui_impl_win32.cpp", "ImGui/backends/imgui_impl_vulkan.cpp", "ImGui/backends/imgui_impl_opengl3.cpp", "ImGui/backends/imgui_win_shader_blobs.cpp"]
proto_deps = list(map(lambda a: a.replace(".proto", ".pb.cc"), files_from_dir("dll", ".proto")))
all_deps = proto_deps + files_from_dir("detours", ".cpp") + controller_deps + imgui_deps + files_from_dir("overlay_experimental/System", ".cpp")
sc_different_deps = ["flat.cpp", "dll.cpp"]
steam_deps = files_from_dir("dll", ".cpp", sc_different_deps)
overlay_deps = files_from_dir("overlay_experimental", ".cpp") + files_from_dir("overlay_experimental/windows", ".cpp")
experimental_steam_deps = steam_deps + overlay_deps
sc_different_deps = list(map(lambda a: "dll/" + a, sc_different_deps))
regular_files = []
head = """@echo off
cd /d "%~dp0"
rmdir /S /Q release
mkdir release
mkdir release\experimental
mkdir release\experimental_steamclient
mkdir release\debug_experimental
mkdir release\debug_experimental_steamclient
call build_set_protobuf_directories.bat
"""
head_32bit = """"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
"""
head_64bit = """"%PROTOC_X64_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\\net.proto
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
"""
footer = """
copy Readme_release.txt release\Readme.txt
xcopy /s files_example\* release\\
copy Readme_experimental.txt release\experimental\Readme.txt
copy Readme_debug.txt release\debug_experimental\Readme.txt
copy steamclient_loader\ColdClientLoader.ini release\experimental_steamclient\\
call build_win_lobby_connect.bat
call build_win_find_interfaces.bat
"""
out = head
out += head_32bit
deps_folder = "deps"
sc_deps_folder = "deps_sc"
def generate_common(include_arch, linker_arch, steam_api_name, steamclient_name):
out = ""
out += cl_line_obj(normal_build_args + release_build_args + include_arch + all_deps, deps_folder)
out += cl_line_link(normal_build_args + release_build_args + include_arch + steam_deps + sc_different_deps + ["deps/net.pb.obj"] + linker_arch + normal_linker_libs, ["/debug:none", "/OUT:release\\{}".format(steam_api_name)])
debug_full_args = normal_build_args + debug_build_args + experimental_build_args + include_arch
out += cl_line_obj(debug_full_args + experimental_steam_deps, sc_deps_folder)
debug_full_dll_args = debug_full_args + sc_different_deps + convert_to_obj(all_deps, deps_folder) + convert_to_obj(experimental_steam_deps, sc_deps_folder) + linker_arch + experimental_linker_libs
out += cl_line_link(debug_full_dll_args, ["/OUT:release\debug_experimental\\{}".format(steam_api_name)])
out += cl_line_link(steamclient_build_args + debug_full_dll_args, ["/OUT:release\debug_experimental_steamclient\\{}".format(steamclient_name)])
release_full_args = normal_build_args + release_build_args + experimental_build_args + include_arch
out += cl_line_obj(release_full_args + experimental_steam_deps, sc_deps_folder)
release_full_dll_args = release_full_args + sc_different_deps + convert_to_obj(all_deps, deps_folder) + convert_to_obj(experimental_steam_deps, sc_deps_folder) + linker_arch + experimental_linker_libs
out += cl_line_link(release_full_dll_args, ["/debug:none", "/OUT:release\experimental\\{}".format(steam_api_name)])
out += cl_line_link(steamclient_build_args + release_full_dll_args, ["/debug:none", "/OUT:release\experimental_steamclient\\{}".format(steamclient_name)])
out += cl_line_link(release_build_args + experimental_build_args + ["steamclient.cpp"] + normal_build_args, ["/debug:none", "/OUT:release\experimental\\{}".format(steamclient_name)])
return out
out += generate_common(includes_32, linker_32, "steam_api.dll", "steamclient.dll")
out += cl_line_exe(files_from_dir("steamclient_loader", ".cpp") + ["advapi32.lib", "user32.lib"] + normal_build_args, ["/debug:none", "/OUT:release\experimental_steamclient\steamclient_loader.exe"])
out += head_64bit
out += generate_common(includes_64, linker_64, "steam_api64.dll", "steamclient64.dll")
out += footer
with open("build_win_release_test.bat", "w") as f:
f.write(out)