Merge branch 'use_cross_compilers_and_vcpkg' into 'master'
Use cross compilers and vcpkg See merge request Mr_Goldberg/goldberg_emulator!35
This commit is contained in:
commit
da260f4c79
255
.gitlab-ci.yml
255
.gitlab-ci.yml
|
@ -4,9 +4,184 @@ stages:
|
|||
- deploy
|
||||
- page_deploy
|
||||
|
||||
static:linux:deps:
|
||||
stage: dependencies
|
||||
image: nemirtingas/linux_vcpkg:ubuntu18
|
||||
#when: manual
|
||||
|
||||
script:
|
||||
- apt update && apt -y install libgl1-mesa-dev libgl1-mesa-dev:i386
|
||||
- dependencies=("glew" "protobuf[zlib]" "curl[core,openssl]" "nlohmann-json" "nlohmann-fifo-map" "stb")
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- VCPKG_PATH=$(pwd)/vcpkg
|
||||
- TRIPLET=x86-linux-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- TRIPLET=x64-linux-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- exit 0
|
||||
|
||||
cache:
|
||||
key: static-linux-deps-cache
|
||||
paths:
|
||||
- vcpkg
|
||||
artifacts:
|
||||
paths:
|
||||
- vcpkg
|
||||
expire_in: 1 day
|
||||
|
||||
static:windows:deps:
|
||||
stage: dependencies
|
||||
image: nemirtingas/windowscross_vcpkg:msvc2019_win10.0.18362.0
|
||||
#when: manual
|
||||
|
||||
script:
|
||||
- dependencies=("glew" "protobuf[zlib]" "curl[core,winssl]" "nlohmann-json" "nlohmann-fifo-map" "stb")
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- VCPKG_PATH=$(pwd)/vcpkg
|
||||
- TRIPLET=x64-linux
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install protobuf:${TRIPLET} || exit 1
|
||||
- TRIPLET=x86-windows-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- TRIPLET=x64-windows-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- exit 0
|
||||
|
||||
cache:
|
||||
key: static-windows-deps-cache
|
||||
paths:
|
||||
- vcpkg
|
||||
artifacts:
|
||||
paths:
|
||||
- vcpkg
|
||||
expire_in: 1 day
|
||||
|
||||
static:macosx:deps:
|
||||
stage: dependencies
|
||||
image: nemirtingas/osxcross_vcpkg:SDK10.13
|
||||
#when: manual
|
||||
|
||||
script:
|
||||
- dependencies=("protobuf[zlib]" "curl[core,openssl]" "nlohmann-json" "nlohmann-fifo-map" "stb")
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- VCPKG_PATH=$(pwd)/vcpkg
|
||||
- TRIPLET=x64-linux
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install protobuf:${TRIPLET} || exit 1
|
||||
- TRIPLET=x86-macosx-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- TRIPLET=x64-macosx-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- exit 0
|
||||
|
||||
cache:
|
||||
key: static-macosx-deps-cache
|
||||
paths:
|
||||
- vcpkg/
|
||||
artifacts:
|
||||
paths:
|
||||
- vcpkg/
|
||||
expire_in: 1 day
|
||||
|
||||
build:linux:
|
||||
stage: build
|
||||
image: nemirtingas/linux_vcpkg:ubuntu18
|
||||
dependencies:
|
||||
- static:linux:deps
|
||||
needs:
|
||||
- static:linux:deps
|
||||
|
||||
script:
|
||||
- apt update && apt -y install libgl1-mesa-dev libgl1-mesa-dev:i386
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- VCPKG_PATH=$(pwd)/vcpkg
|
||||
- TOOLCHAIN="/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
- TRIPLET=x86-linux-goldberg
|
||||
- OUT=linux32/Release
|
||||
- cmake -G Ninja -Wno-dev -DX86=ON -DCMAKE_BUILD_TYPE=Release "-DVCPKG_TARGET_TRIPLET=${TRIPLET}" "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}" "-D_VCPKG_INSTALLED_DIR=${VCPKG_PATH}" -S . -B "${OUT}"
|
||||
- cmake --build "${OUT}"
|
||||
- cmake --install "${OUT}"
|
||||
- TRIPLET=x64-linux-goldberg
|
||||
- OUT=linux64/Release
|
||||
- cmake -G Ninja -Wno-dev -DX64=ON -DCMAKE_BUILD_TYPE=Release "-DVCPKG_TARGET_TRIPLET=${TRIPLET}" "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}" "-D_VCPKG_INSTALLED_DIR=${VCPKG_PATH}" -S . -B "${OUT}"
|
||||
- cmake --build "${OUT}"
|
||||
- cmake --install "${OUT}"
|
||||
- exit 0
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- release/
|
||||
- debug/
|
||||
expire_in: 1 day
|
||||
|
||||
build:windows:
|
||||
stage: build
|
||||
image: nemirtingas/windowscross_vcpkg:msvc2019_win10.0.18362.0
|
||||
dependencies:
|
||||
- static:windows:deps
|
||||
needs:
|
||||
- static:windows:deps
|
||||
|
||||
script:
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- VCPKG_PATH=$(pwd)/vcpkg
|
||||
- TOOLCHAIN="/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
- CHAINLOAD="/clang_windows_sdk/clang-cl-msvc.cmake"
|
||||
- export HOST_ARCH=x86
|
||||
- TRIPLET=x86-windows-goldberg
|
||||
- OUT=win32/Release
|
||||
- cmake -G Ninja -Wno-dev -DX86=ON -DCMAKE_BUILD_TYPE=Release "-DVCPKG_TARGET_TRIPLET=${TRIPLET}" "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${CHAINLOAD}" "-D_VCPKG_INSTALLED_DIR=${VCPKG_PATH}" -S . -B "${OUT}"
|
||||
- cmake --build "${OUT}"
|
||||
- cmake --install "${OUT}"
|
||||
- export HOST_ARCH=x64
|
||||
- TRIPLET=x64-windows-goldberg
|
||||
- OUT=win64/Release
|
||||
- cmake -G Ninja -Wno-dev -DX64=ON -DCMAKE_BUILD_TYPE=Release "-DVCPKG_TARGET_TRIPLET=${TRIPLET}" "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${CHAINLOAD}" "-D_VCPKG_INSTALLED_DIR=${VCPKG_PATH}" -S . -B "${OUT}"
|
||||
- cmake --build "${OUT}"
|
||||
- cmake --install "${OUT}"
|
||||
artifacts:
|
||||
paths:
|
||||
- release/
|
||||
- debug/
|
||||
expire_in: 1 day
|
||||
|
||||
build:macosx:
|
||||
stage: build
|
||||
image: nemirtingas/osxcross_vcpkg:SDK10.13
|
||||
dependencies:
|
||||
- static:macosx:deps
|
||||
needs:
|
||||
- static:macosx:deps
|
||||
|
||||
script:
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- VCPKG_PATH=$(pwd)/vcpkg
|
||||
- TOOLCHAIN="/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
- CHAINLOAD="/osxcross/target/toolchain.cmake"
|
||||
- export OSXCROSS_HOST=i386-apple-${OSXCROSS_TARGET}
|
||||
- TRIPLET=x86-macosx-goldberg
|
||||
- OUT=macosx32/Release
|
||||
- cmake -G Ninja -Wno-dev -DX86=ON -DCMAKE_BUILD_TYPE=Release "-DVCPKG_TARGET_TRIPLET=${TRIPLET}" "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${CHAINLOAD}" "-D_VCPKG_INSTALLED_DIR=${VCPKG_PATH}" -S . -B "${OUT}"
|
||||
- cmake --build "${OUT}"
|
||||
- cmake --install "${OUT}"
|
||||
- export OSXCROSS_HOST=x86_64-apple-${OSXCROSS_TARGET}
|
||||
- TRIPLET=x64-macosx-goldberg
|
||||
- OUT=macosx64/Release
|
||||
- cmake -G Ninja -Wno-dev -DX64=ON -DCMAKE_BUILD_TYPE=Release "-DVCPKG_TARGET_TRIPLET=${TRIPLET}" "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${CHAINLOAD}" "-D_VCPKG_INSTALLED_DIR=${VCPKG_PATH}" -S . -B "${OUT}"
|
||||
- cmake --build "${OUT}"
|
||||
- cmake --install "${OUT}"
|
||||
- mkdir release/macosx
|
||||
- x86_64-apple-${OSXCROSS_TARGET}-lipo -create release/macosx*/steamclient.dylib -output release/macosx/steamclient.dylib
|
||||
- x86_64-apple-${OSXCROSS_TARGET}-lipo -create release/macosx*/libsteam_api.dylib -output release/macosx/libsteam_api.dylib
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- release/
|
||||
- debug/
|
||||
expire_in: 1 day
|
||||
|
||||
protobuf_static_steamos:
|
||||
stage: dependencies
|
||||
image: tianon/steamos
|
||||
when: manual
|
||||
|
||||
script:
|
||||
# don't rebuild every time
|
||||
|
@ -39,6 +214,8 @@ build_steamos:
|
|||
image: tianon/steamos
|
||||
dependencies:
|
||||
- protobuf_static_steamos
|
||||
needs:
|
||||
- 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
|
||||
|
@ -57,6 +234,8 @@ build_steamos:
|
|||
build_windows:
|
||||
stage: build
|
||||
image: fedora:29
|
||||
needs:
|
||||
- protobuf_static_steamos
|
||||
|
||||
script:
|
||||
- dnf -y install wine wget p7zip sed dos2unix
|
||||
|
@ -94,83 +273,21 @@ build_windows:
|
|||
- 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
|
||||
image: alpine
|
||||
dependencies:
|
||||
- build_windows
|
||||
- build_steamos
|
||||
- build:windows
|
||||
- build:linux
|
||||
- build:macosx
|
||||
|
||||
script:
|
||||
- apk --no-cache add git tree
|
||||
- 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)
|
||||
- find . -mindepth 1 -maxdepth 1 ! -name release -exec rm -rf '{}' \;
|
||||
- mv release/* ./
|
||||
- rm -rf release
|
||||
- echo $CI_JOB_ID > job_id
|
||||
|
@ -196,4 +313,4 @@ pages:
|
|||
paths:
|
||||
- public/
|
||||
only:
|
||||
- master
|
||||
- master
|
579
CMakeLists.txt
579
CMakeLists.txt
|
@ -1,331 +1,490 @@
|
|||
# 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)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
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 11)
|
||||
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)
|
||||
# Workaround because cross-compiling with CMake + vcpkg fucks up this variable
|
||||
# making the 'find_*' functions/macros somehow fail to find the right arch.
|
||||
# There are conditions like
|
||||
# CMAKE_SIZEOF_VOID_P = "4" then look for i386 libraries...
|
||||
# or
|
||||
# CMAKE_SIZEOF_VOID_P = "8" then look for x86_64 libraries...
|
||||
if(X86 AND NOT X64)
|
||||
set(CMAKE_SIZEOF_VOID_P "4")
|
||||
elseif(X64 AND NOT X86)
|
||||
set(CMAKE_SIZEOF_VOID_P "8")
|
||||
else()
|
||||
message(FATAL_ERROR "Other platforms not supported...")
|
||||
message(FATAL_ERROR "Please define either -DX86=ON or -DX64=ON")
|
||||
endif()
|
||||
|
||||
# Gather the files that are shared between multiple targets
|
||||
file(GLOB DLL_SRC_SHARED
|
||||
dll/*.h
|
||||
dll/*.cpp
|
||||
)
|
||||
if(WIN32) # Setup some variables for Windows build
|
||||
if(MSVC) # If building with MSVC
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) # Disable warning about strncpy_s and his friends
|
||||
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:\"msvcrtd.lib\"") # Disable this linkage
|
||||
#set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\"msvcrtd.lib\"") # Disable this linkage
|
||||
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) # Force to only build Debug & Release projects
|
||||
|
||||
file(GLOB DETOURS_SRC_SHARED
|
||||
detours/*.cpp
|
||||
)
|
||||
set(CompilerFlags
|
||||
CMAKE_CXX_FLAGS
|
||||
CMAKE_CXX_FLAGS_DEBUG
|
||||
CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_RELEASE
|
||||
)
|
||||
foreach(CompilerFlag ${CompilerFlags})
|
||||
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
|
||||
endforeach()
|
||||
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
file(GLOB OVERLAY_EXPERIMENTAL_SRC_SHARED
|
||||
if(X64)
|
||||
set(LIB_STEAM_API steam_api64)
|
||||
set(LIB_STEAMCLIENT steamclient64)
|
||||
set(OUT_DIR win64)
|
||||
elseif(X86)
|
||||
set(LIB_STEAM_API steam_api)
|
||||
set(LIB_STEAMCLIENT steamclient)
|
||||
set(OUT_DIR win32)
|
||||
else()
|
||||
message(FATAL_ERROR "Arch unknown")
|
||||
endif()
|
||||
|
||||
|
||||
file(
|
||||
GLOB
|
||||
overlay_sources
|
||||
overlay_experimental/*.cpp
|
||||
overlay_experimental/windows/*.cpp
|
||||
ImGui/*.cpp
|
||||
ImGui/impls/*.cpp
|
||||
ImGui/impls/windows/*.cpp
|
||||
glew/glew.c
|
||||
)
|
||||
|
||||
set(overlay_includes
|
||||
overlay_experimental/
|
||||
overlay_experimental/windows/
|
||||
ImGui/
|
||||
)
|
||||
|
||||
elseif(APPLE)
|
||||
if(X64)
|
||||
# Global flags for building steamapi (64bits)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m64")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m64")
|
||||
#set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -m64")
|
||||
set(OUT_DIR macosx64)
|
||||
elseif(X86)
|
||||
# Global flags for building steamapi (32bits)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
|
||||
#set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -m32")
|
||||
set(OUT_DIR macosx32)
|
||||
else()
|
||||
message(FATAL_ERROR "Arch unknown")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
|
||||
|
||||
set(LIB_STEAM_API steam_api)
|
||||
set(LIB_STEAMCLIENT steamclient)
|
||||
|
||||
file(
|
||||
GLOB
|
||||
overlay_sources
|
||||
overlay_experimental/Renderer_Detector.cpp
|
||||
overlay_experimental/macosx/*.cpp
|
||||
)
|
||||
|
||||
set(overlay_includes
|
||||
overlay_experimental/
|
||||
overlay_experimental/macosx/
|
||||
ImGui/
|
||||
)
|
||||
|
||||
elseif(UNIX)
|
||||
file(GLOB OVERLAY_EXPERIMENTAL_SRC_SHARED
|
||||
if(X64)
|
||||
# Global flags for building steamapi (64bits)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m64")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m64")
|
||||
#set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -m64")
|
||||
set(OUT_DIR linux64)
|
||||
elseif(X86)
|
||||
# Global flags for building steamapi (32bits)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
|
||||
#set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -m32")
|
||||
set(OUT_DIR linux32)
|
||||
else()
|
||||
message(FATAL_ERROR "Arch unknown")
|
||||
endif()
|
||||
set(LIB_STEAM_API steam_api)
|
||||
set(LIB_STEAMCLIENT steamclient)
|
||||
|
||||
file(
|
||||
GLOB
|
||||
overlay_sources
|
||||
overlay_experimental/*.cpp
|
||||
overlay_experimental/linux/*.cpp
|
||||
ImGui/*.cpp
|
||||
ImGui/impls/*.cpp
|
||||
ImGui/impls/linux/*.cpp
|
||||
glew/glew.c
|
||||
)
|
||||
|
||||
set(overlay_includes
|
||||
overlay_experimental/
|
||||
overlay_experimental/linux/
|
||||
ImGui/
|
||||
)
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "No CMake for other platforms")
|
||||
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
option(EMU_EXPERIMENTAL_BUILD "Enable experimental build" OFF)
|
||||
if(EMU_EXPERIMENTAL_BUILD)
|
||||
if(APPLE)
|
||||
set(EMU_OVERLAY OFF)
|
||||
else()
|
||||
option(EMU_OVERLAY "Enable the emulator overlay" ON)
|
||||
endif()
|
||||
else()
|
||||
set(EMU_OVERLAY OFF)
|
||||
endif()
|
||||
|
||||
|
||||
#set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Debug or Release")
|
||||
|
||||
set(Protobuf_USE_STATIC_LIBS ON)
|
||||
include(FindProtobuf)
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(Protobuf CONFIG REQUIRED)
|
||||
find_package(CURL CONFIG REQUIRED)
|
||||
find_package(nlohmann_json CONFIG REQUIRED)
|
||||
find_package(nlohmann-fifo-map CONFIG REQUIRED)
|
||||
find_path(STB_INCLUDE_DIRS "stb.h")
|
||||
|
||||
if(NOT WIN32)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT APPLE AND EMU_OVERLAY)
|
||||
find_package(GLEW REQUIRED)
|
||||
endif()
|
||||
|
||||
########################################
|
||||
## net.h net.cc
|
||||
file(
|
||||
GLOB
|
||||
protobuf_sources
|
||||
dll/*.proto
|
||||
)
|
||||
protobuf_generate_cpp(net_PROTO_SRCS net_PROTO_HDRS ${protobuf_sources})
|
||||
|
||||
########################################
|
||||
## steamclient[64].dll
|
||||
file(
|
||||
GLOB
|
||||
emu_sources
|
||||
dll/*.cpp
|
||||
)
|
||||
|
||||
file(GLOB detour_sources
|
||||
detours/*.cpp
|
||||
)
|
||||
|
||||
###################################################
|
||||
# Setup for the steam_api(64).dll / libsteam_api.so
|
||||
# Setup for the steam_api
|
||||
###################################################
|
||||
|
||||
# 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}
|
||||
SHARED
|
||||
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${detour_sources}>
|
||||
$<$<AND:$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:${overlay_sources}>
|
||||
${emu_sources}
|
||||
${net_PROTO_SRCS}
|
||||
${net_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
|
||||
target_include_directories(
|
||||
${LIB_STEAM_API}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${STB_INCLUDE_DIRS}
|
||||
|
||||
${overlay_includes}
|
||||
)
|
||||
|
||||
# Link the required libraries
|
||||
target_link_libraries(${LIB_STEAM_API}
|
||||
PRIVATE
|
||||
protobuf::libprotobuf
|
||||
Threads::Threads
|
||||
protobuf::libprotobuf-lite
|
||||
nlohmann_json::nlohmann_json
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
|
||||
|
||||
$<$<AND:$<NOT:$<BOOL:${APPLE}>>,$<BOOL:${EMU_OVERLAY}>>:GLEW::GLEW>
|
||||
|
||||
$<$<BOOL:${WIN32}>:comdlg32>
|
||||
$<$<BOOL:${WIN32}>:advapi32>
|
||||
$<$<BOOL:${WIN32}>:shell32>
|
||||
$<$<BOOL:${WIN32}>:user32>
|
||||
$<$<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>
|
||||
$<$<AND:$<BOOL:${WIN32}>,$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:winmm.lib>
|
||||
|
||||
# For library UNIX loading
|
||||
$<$<NOT:$<BOOL:${WIN32}>>:dl>
|
||||
# For overlay opengl
|
||||
$<$<AND:$<BOOL:${UNIX}>,$<NOT:$<BOOL:${APPLE}>>,$<BOOL:${EMU_OVERLAY}>>:GL>
|
||||
)
|
||||
|
||||
# Add target compile definitions
|
||||
target_compile_definitions(${LIB_STEAM_API}
|
||||
PRIVATE
|
||||
GLEW_NO_GLU
|
||||
STBI_NO_SIMD
|
||||
|
||||
$<$<CONFIG:>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:Release>: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 for the steamclient
|
||||
########################################################
|
||||
|
||||
# Setup the target
|
||||
add_library(${LIB_STEAMCLIENT}
|
||||
SHARED
|
||||
steamclient.cpp
|
||||
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${detour_sources}>
|
||||
$<$<AND:$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:${overlay_sources}>
|
||||
${emu_sources}
|
||||
${net_PROTO_SRCS}
|
||||
${net_PROTO_HDRS}
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
SET_TARGET_PROPERTIES(${LIB_STEAMCLIENT} PROPERTIES PREFIX "")
|
||||
endif()
|
||||
|
||||
# Include the required directories
|
||||
target_include_directories(
|
||||
${LIB_STEAMCLIENT}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${STB_INCLUDE_DIRS}
|
||||
|
||||
${overlay_includes}
|
||||
)
|
||||
|
||||
# Link the required libraries
|
||||
target_link_libraries(${LIB_STEAMCLIENT}
|
||||
PRIVATE
|
||||
Threads::Threads
|
||||
protobuf::libprotobuf-lite
|
||||
nlohmann_json::nlohmann_json
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
|
||||
$<$<AND:$<NOT:$<BOOL:${APPLE}>>,$<BOOL:${EMU_OVERLAY}>>:GLEW::GLEW>
|
||||
|
||||
$<$<BOOL:${WIN32}>:comdlg32>
|
||||
$<$<BOOL:${WIN32}>:advapi32>
|
||||
$<$<BOOL:${WIN32}>:shell32>
|
||||
$<$<BOOL:${WIN32}>:user32>
|
||||
$<$<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>
|
||||
|
||||
# For library UNIX loading
|
||||
$<$<NOT:$<BOOL:${WIN32}>>:dl>
|
||||
# For overlay opengl
|
||||
$<$<AND:$<BOOL:${UNIX}>,$<NOT:$<BOOL:${APPLE}>>,$<BOOL:${EMU_OVERLAY}>>:GL>
|
||||
)
|
||||
|
||||
# Add target compile definitions
|
||||
target_compile_definitions(${LIB_STEAMCLIENT}
|
||||
PRIVATE
|
||||
GLEW_NO_GLU
|
||||
STBI_NO_SIMD
|
||||
STEAMCLIENT_DLL
|
||||
|
||||
$<$<CONFIG:>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:Release>: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>
|
||||
)
|
||||
|
||||
# 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 for the lobby_connect
|
||||
###########################################################################
|
||||
|
||||
# Setup the target
|
||||
add_executable(${BIN_LOBBY_CONNECT}
|
||||
add_executable(lobby_connect
|
||||
lobby_connect.cpp
|
||||
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${DETOURS_SRC_SHARED}>
|
||||
${DLL_SRC_SHARED}
|
||||
${PROTO_SRCS}
|
||||
${PROTO_HDRS}
|
||||
${emu_sources}
|
||||
${net_PROTO_SRCS}
|
||||
${net_PROTO_HDRS}
|
||||
)
|
||||
|
||||
target_include_directories(${BIN_LOBBY_CONNECT}
|
||||
# Include the required directories
|
||||
target_include_directories(
|
||||
lobby_connect
|
||||
PRIVATE
|
||||
${PROTOBUF_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${STB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Link the required libraries
|
||||
target_link_libraries(${BIN_LOBBY_CONNECT}
|
||||
target_link_libraries(lobby_connect
|
||||
PRIVATE
|
||||
protobuf::libprotobuf
|
||||
Threads::Threads
|
||||
protobuf::libprotobuf-lite
|
||||
nlohmann_json::nlohmann_json
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
|
||||
$<$<BOOL:${WIN32}>:comdlg32>
|
||||
$<$<BOOL:${WIN32}>:advapi32>
|
||||
$<$<BOOL:${WIN32}>:shell32>
|
||||
$<$<BOOL:${WIN32}>:user32>
|
||||
$<$<BOOL:${WIN32}>:ws2_32>
|
||||
$<$<BOOL:${WIN32}>:iphlpapi>
|
||||
$<$<BOOL:${WIN32}>:comdlg32>
|
||||
${CMAKE_DL_LIBS}
|
||||
-debug:none
|
||||
|
||||
# For library UNIX loading
|
||||
$<$<NOT:$<BOOL:${WIN32}>>:dl>
|
||||
)
|
||||
|
||||
# Add target compile definitions
|
||||
target_compile_definitions(${BIN_LOBBY_CONNECT}
|
||||
target_compile_definitions(lobby_connect
|
||||
PRIVATE
|
||||
NO_DISK_WRITES
|
||||
LOBBY_CONNECT
|
||||
|
||||
$<$<CONFIG:>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:Release>: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 for the generate_interfaces_file
|
||||
###########################################################################
|
||||
|
||||
# Setup the target
|
||||
add_executable(${BIN_GENERATE_INTERFACES_FILE}
|
||||
add_executable(
|
||||
generate_interfaces
|
||||
generate_interfaces_file.cpp
|
||||
)
|
||||
|
||||
# Link the required libraries
|
||||
target_link_libraries(${BIN_GENERATE_INTERFACES_FILE}
|
||||
target_link_libraries(
|
||||
generate_interfaces
|
||||
PRIVATE
|
||||
-debug:none
|
||||
)
|
||||
|
||||
# Setup install rules for the target
|
||||
###########################################################################
|
||||
# Setup for the generate_game_infos
|
||||
###########################################################################
|
||||
|
||||
# Setup the target
|
||||
add_executable(
|
||||
generate_game_infos
|
||||
generate_game_infos/generate_game_infos.cpp
|
||||
)
|
||||
|
||||
# Link the required libraries
|
||||
target_link_libraries(
|
||||
generate_game_infos
|
||||
PRIVATE
|
||||
nlohmann_json::nlohmann_json
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
CURL::libcurl
|
||||
-debug:none
|
||||
)
|
||||
|
||||
###########################################################################
|
||||
# Installation setup
|
||||
###########################################################################
|
||||
|
||||
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
||||
set(OUT_DIR debug/${OUT_DIR})
|
||||
else()
|
||||
set(OUT_DIR release/${OUT_DIR})
|
||||
endif()
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR})
|
||||
|
||||
# emulators
|
||||
install(
|
||||
TARGETS ${LIB_STEAM_API} ${LIB_STEAMCLIENT}
|
||||
RUNTIME DESTINATION ${OUT_DIR}
|
||||
LIBRARY DESTINATION ${OUT_DIR}
|
||||
)
|
||||
|
||||
# generate_interfaces
|
||||
install(TARGETS
|
||||
${BIN_GENERATE_INTERFACES_FILE}
|
||||
RUNTIME DESTINATION tools/
|
||||
generate_interfaces
|
||||
RUNTIME DESTINATION ${OUT_DIR}/tools/generate_interfaces
|
||||
)
|
||||
|
||||
###########################################################################
|
||||
# Installation setup for non target files and directories
|
||||
###########################################################################
|
||||
|
||||
install(FILES
|
||||
Readme_lobby_connect.txt
|
||||
DESTINATION lobby_connect/
|
||||
)
|
||||
|
||||
install(FILES
|
||||
install(FILES
|
||||
scripts/find_interfaces.sh
|
||||
scripts/find_interfaces.ps1
|
||||
Readme_generate_interfaces.txt
|
||||
DESTINATION tools/
|
||||
DESTINATION ${OUT_DIR}/tools/generate_interfaces
|
||||
)
|
||||
|
||||
install(FILES
|
||||
# generate_game_infos
|
||||
install(TARGETS
|
||||
generate_game_infos
|
||||
RUNTIME DESTINATION ${OUT_DIR}/tools/generate_game_infos
|
||||
)
|
||||
|
||||
# lobby_connect
|
||||
install(TARGETS
|
||||
lobby_connect
|
||||
RUNTIME DESTINATION ${OUT_DIR}/tools/lobby_connect
|
||||
)
|
||||
install(FILES
|
||||
Readme_lobby_connect.txt
|
||||
DESTINATION ${OUT_DIR}/tools/lobby_connect
|
||||
)
|
||||
|
||||
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 ./
|
||||
DESTINATION ${OUT_DIR}
|
||||
)
|
||||
|
||||
install(DIRECTORY
|
||||
install(DIRECTORY
|
||||
files_example/steam_settings.EXAMPLE
|
||||
DESTINATION ./
|
||||
)
|
||||
DESTINATION ${OUT_DIR}
|
||||
)
|
|
@ -1,520 +0,0 @@
|
|||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -7,10 +7,10 @@ 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++11 && 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++11 && 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++11 && echo built32_steamclient
|
||||
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. -I../protobuf/prefix_x86/include/ -L../protobuf/prefix_x86/lib/ -lprotobuf-lite -lpthread -ldl -std=c++11 && 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. -I../protobuf/prefix_x86/include/ -L../protobuf/prefix_x86/lib/ -lprotobuf-lite -lpthread -ldl -std=c++11 && 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. -I../protobuf/prefix_x86/include/ -L../protobuf/prefix_x86/lib/ -lprotobuf-lite -lpthread -ldl -std=c++11 && 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++11 && 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++11 && 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++11 && echo built64_steamclient
|
||||
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. -I../protobuf/prefix/include/ -L../protobuf/prefix/lib/ -lprotobuf-lite -lpthread -ldl -std=c++11 && 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. -I../protobuf/prefix/include/ -L../protobuf/prefix/lib/ -lprotobuf-lite -lpthread -ldl -std=c++11 && 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. -I../protobuf/prefix/include/ -L../protobuf/prefix/lib/ -lprotobuf-lite -lpthread -ldl -std=c++11 && echo built64_steamclient
|
||||
|
|
|
@ -4,11 +4,11 @@ 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 /Iglew\include /I%PROTOBUF_X86_DIRECTORY%\include\ /DGLEW_STATIC /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X86_LIBRARY%" glew\glew.c opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /link /OUT:steam_api.dll
|
||||
cl /LD /I. /IImGui /Iglew\include /I%PROTOBUF_X86_DIRECTORY%\include\ /DGLEW_STATIC /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X86_LIBRARY%" glew\glew.c 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 /LD /IImGui /Iglew\include /I%PROTOBUF_X64_DIRECTORY%\include\ /DGLEW_STATIC /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X64_LIBRARY%" glew\glew.c opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /link /OUT:steam_api64.dll
|
||||
cl /LD /I. /IImGui /Iglew\include /I%PROTOBUF_X64_DIRECTORY%\include\ /DGLEW_STATIC /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X64_LIBRARY%" glew\glew.c 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
|
||||
|
|
|
@ -6,7 +6,7 @@ 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
|
||||
cl /DNO_DISK_WRITES /DLOBBY_CONNECT /DEMU_RELEASE_BUILD /DNDEBUG /I. /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
|
||||
|
|
|
@ -10,12 +10,12 @@ 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
|
||||
cl /LD /DEMU_RELEASE_BUILD /DNDEBUG /I. /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
|
||||
cl /LD /DEMU_RELEASE_BUILD /DNDEBUG /I. /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
|
||||
|
|
|
@ -6,11 +6,11 @@ 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 /DGLEW_STATIC /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DNDEBUG /IImGui /Iglew\include /I%PROTOBUF_X86_DIRECTORY%\include\ dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X86_LIBRARY%" glew\glew.c 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 /DGLEW_STATIC /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DNDEBUG /I. /IImGui /Iglew\include /I%PROTOBUF_X86_DIRECTORY%\include\ dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X86_LIBRARY%" glew\glew.c 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 /MP12 /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 /DGLEW_STATIC /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DNDEBUG /IImGui /Iglew\include /I%PROTOBUF_X64_DIRECTORY%\include\ dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X64_LIBRARY%" glew\glew.c 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 /DGLEW_STATIC /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DNDEBUG /I. /IImGui /Iglew\include /I%PROTOBUF_X64_DIRECTORY%\include\ dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X64_LIBRARY%" glew\glew.c 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 /MP12 /Ox /link /OUT:release\experimental\steamclient64.dll
|
||||
copy Readme_experimental.txt release\experimental\Readme.txt
|
||||
|
|
|
@ -6,11 +6,11 @@ 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 /DGLEW_STATIC /IImGui /Iglew\include /DNDEBUG /I%PROTOBUF_X86_DIRECTORY%\include\ dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X86_LIBRARY%" glew\glew.c 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
|
||||
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DGLEW_STATIC /I. /IImGui /Iglew\include /DNDEBUG /I%PROTOBUF_X86_DIRECTORY%\include\ dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X86_LIBRARY%" glew\glew.c 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 /DGLEW_STATIC /IImGui /Iglew\include /DNDEBUG /I%PROTOBUF_X64_DIRECTORY%\include\ dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X64_LIBRARY%" glew\glew.c 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
|
||||
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DGLEW_STATIC /I. /IImGui /Iglew\include /DNDEBUG /I%PROTOBUF_X64_DIRECTORY%\include\ dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/impls/*.cpp ImGui/impls/windows/*.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp "%PROTOBUF_X64_LIBRARY%" glew\glew.c 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
|
||||
|
|
52
dll/base.cpp
52
dll/base.cpp
|
@ -150,44 +150,18 @@ bool check_timedout(std::chrono::high_resolution_clock::time_point old, double t
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef __LINUX__
|
||||
std::string get_lib_path() {
|
||||
std::string dir = "/proc/self/map_files";
|
||||
DIR *dp;
|
||||
int i = 0;
|
||||
struct dirent *ep;
|
||||
dp = opendir (dir.c_str());
|
||||
uintptr_t p = (uintptr_t)&get_lib_path;
|
||||
#if defined(__LINUX__) || defined(__APPLE__)
|
||||
std::string get_lib_path()
|
||||
{
|
||||
std::string library_path = "./";
|
||||
|
||||
if (dp != NULL)
|
||||
{
|
||||
while ((ep = readdir (dp))) {
|
||||
if (memcmp(ep->d_name, ".", 2) != 0 && memcmp(ep->d_name, "..", 3) != 0) {
|
||||
char *upper = NULL;
|
||||
uintptr_t lower_bound = strtoull(ep->d_name, &upper, 16);
|
||||
if (lower_bound) {
|
||||
++upper;
|
||||
uintptr_t upper_bound = strtoull(upper, &upper, 16);
|
||||
if (upper_bound && (lower_bound < p && p < upper_bound)) {
|
||||
std::string path = dir + PATH_SEPARATOR + ep->d_name;
|
||||
char link[PATH_MAX] = {};
|
||||
if (readlink(path.c_str(), link, sizeof(link)) > 0) {
|
||||
std::string lib_path = link;
|
||||
(void) closedir (dp);
|
||||
return link;
|
||||
}
|
||||
}
|
||||
}
|
||||
Dl_info infos;
|
||||
dladdr((void*)&get_lib_path, &infos);
|
||||
library_path = infos.dli_fname;
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
(void) closedir (dp);
|
||||
}
|
||||
|
||||
return ".";
|
||||
return library_path;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
std::string get_full_lib_path()
|
||||
|
@ -222,10 +196,10 @@ std::string get_full_program_path()
|
|||
std::string get_current_path()
|
||||
{
|
||||
std::string path;
|
||||
#if defined(STEAM_WIN32)
|
||||
#if defined(__WINDOWS__)
|
||||
char *buffer = _getcwd( NULL, 0 );
|
||||
#else
|
||||
char *buffer = get_current_dir_name();
|
||||
#elif defined(__LINUX__) || defined(__APPLE__)
|
||||
char *buffer = getcwd( NULL, 0 );
|
||||
#endif
|
||||
if (buffer) {
|
||||
path = buffer;
|
||||
|
@ -246,7 +220,7 @@ std::string canonical_path(std::string path)
|
|||
free(buffer);
|
||||
}
|
||||
#else
|
||||
char *buffer = canonicalize_file_name(path.c_str());
|
||||
char *buffer = realpath(path.c_str(), NULL);
|
||||
if (buffer) {
|
||||
output = buffer;
|
||||
free(buffer);
|
||||
|
|
|
@ -40,6 +40,16 @@
|
|||
#define __LINUX__
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__x86_64__)
|
||||
#define __APPLE_64__
|
||||
#define __64BITS__
|
||||
#else
|
||||
#define __APPLE_32__
|
||||
#define __32BITS__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
#define STEAM_WIN32
|
||||
#ifndef NOMINMAX
|
||||
|
@ -59,8 +69,6 @@
|
|||
#include <iphlpapi.h> // Include winsock2 before this, or winsock2 iphlpapi will be unavailable
|
||||
#include <shlobj.h>
|
||||
|
||||
#define MSG_NOSIGNAL 0
|
||||
|
||||
#define SystemFunction036 NTAPI SystemFunction036
|
||||
#include <ntsecapi.h>
|
||||
#undef SystemFunction036
|
||||
|
@ -105,7 +113,15 @@ inline std::wstring utf8_decode(const std::string &str)
|
|||
return wstrTo;
|
||||
}
|
||||
|
||||
#elif defined(__LINUX__)
|
||||
#elif defined(__LINUX__) || defined(__APPLE__)
|
||||
#if defined(__LINUX__)
|
||||
// Insert here Linux specific headers
|
||||
#else
|
||||
// Insert here MacOS specific headers
|
||||
#include <sys/sysctl.h>
|
||||
#include <mach-o/dyld_images.h>
|
||||
#endif
|
||||
#include <ifaddrs.h>// getifaddrs
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -118,7 +134,6 @@ inline std::wstring utf8_decode(const std::string &str)
|
|||
#include <sys/time.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
@ -136,6 +151,11 @@ inline std::wstring utf8_decode(const std::string &str)
|
|||
|
||||
#define utf8_decode(a) a
|
||||
#endif
|
||||
|
||||
#ifndef MSG_NOSIGNAL
|
||||
#define MSG_NOSIGNAL 0
|
||||
#endif
|
||||
|
||||
//#define PRINT_DEBUG(...) fprintf(stdout, __VA_ARGS__)
|
||||
#ifdef EMU_RELEASE_BUILD
|
||||
#define PRINT_DEBUG(...)
|
||||
|
@ -166,7 +186,8 @@ inline std::wstring utf8_decode(const std::string &str)
|
|||
#include <stdio.h>
|
||||
|
||||
// Other libs includes
|
||||
#include "../json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <nlohmann/fifo_map.hpp>
|
||||
#include "../controller/gamepad.h"
|
||||
|
||||
// Steamsdk includes
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
#if defined(__WINDOWS__)
|
||||
#define STBI_WINDOWS_UTF8
|
||||
#endif
|
||||
#include "../stb/stb_image.h"
|
||||
#include <stb_image.h>
|
||||
|
||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
#define STB_IMAGE_WRITE_STATIC
|
||||
#include "../stb/stb_image_write.h"
|
||||
#include <stb_image_write.h>
|
||||
|
||||
struct File_Data {
|
||||
std::string name;
|
||||
|
|
|
@ -120,68 +120,39 @@ static void get_broadcast_info(uint16 port)
|
|||
}
|
||||
}
|
||||
|
||||
#elif defined(__linux__)
|
||||
#elif defined(__LINUX__) || defined(__APPLE__)
|
||||
|
||||
static void get_broadcast_info(uint16 port)
|
||||
{
|
||||
/* Not sure how many platforms this will run on,
|
||||
* so it's wrapped in __linux for now.
|
||||
* Definitely won't work like this on Windows...
|
||||
*/
|
||||
number_broadcasts = 0;
|
||||
sock_t sock = 0;
|
||||
ifaddrs* ifaces_list;
|
||||
|
||||
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
|
||||
return;
|
||||
number_broadcasts = 0;
|
||||
if (getifaddrs(&ifaces_list) == 0)
|
||||
{
|
||||
const sockaddr_in* sock_addr;
|
||||
for (ifaddrs* pIface = ifaces_list; pIface != nullptr; pIface = pIface->ifa_next)
|
||||
{
|
||||
if (pIface->ifa_addr->sa_family == AF_INET)
|
||||
{
|
||||
sock_addr = reinterpret_cast<const sockaddr_in*>(pIface->ifa_addr);
|
||||
if (sock_addr->sin_addr.s_addr != 0 && pIface->ifa_netmask != nullptr)
|
||||
{
|
||||
uint32_t ip = reinterpret_cast<const sockaddr_in*>(pIface->ifa_addr)->sin_addr.s_addr;
|
||||
uint32_t mask = reinterpret_cast<const sockaddr_in*>(pIface->ifa_netmask)->sin_addr.s_addr;
|
||||
|
||||
/* Configure ifconf for the ioctl call. */
|
||||
struct ifreq i_faces[MAX_BROADCASTS];
|
||||
memset(i_faces, 0, sizeof(struct ifreq) * MAX_BROADCASTS);
|
||||
|
||||
struct ifconf ifconf;
|
||||
ifconf.ifc_buf = (char *)i_faces;
|
||||
ifconf.ifc_len = sizeof(i_faces);
|
||||
|
||||
if (ioctl(sock, SIOCGIFCONF, &ifconf) < 0) {
|
||||
close(sock);
|
||||
return;
|
||||
}
|
||||
|
||||
/* ifconf.ifc_len is set by the ioctl() to the actual length used;
|
||||
* on usage of the complete array the call should be repeated with
|
||||
* a larger array, not done (640kB and 16 interfaces shall be
|
||||
* enough, for everybody!)
|
||||
*/
|
||||
int i, count = ifconf.ifc_len / sizeof(struct ifreq);
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
/* there are interfaces with are incapable of broadcast */
|
||||
if (ioctl(sock, SIOCGIFBRDADDR, &i_faces[i]) < 0)
|
||||
continue;
|
||||
|
||||
/* moot check: only AF_INET returned (backwards compat.) */
|
||||
if (i_faces[i].ifr_broadaddr.sa_family != AF_INET)
|
||||
continue;
|
||||
|
||||
struct sockaddr_in *sock4 = (struct sockaddr_in *)&i_faces[i].ifr_broadaddr;
|
||||
|
||||
if (number_broadcasts >= MAX_BROADCASTS) {
|
||||
close(sock);
|
||||
return;
|
||||
}
|
||||
|
||||
IP_PORT *ip_port = &broadcasts[number_broadcasts];
|
||||
ip_port->ip = sock4->sin_addr.s_addr;
|
||||
|
||||
if (ip_port->ip == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ip_port->port = port;
|
||||
number_broadcasts++;
|
||||
}
|
||||
|
||||
close(sock);
|
||||
IP_PORT *ip_port = &broadcasts[number_broadcasts++];
|
||||
ip_port->ip = ip | ~mask;
|
||||
ip_port->port = port;
|
||||
}
|
||||
}
|
||||
// IPV6
|
||||
//else if (pIface->ifa_addr->sa_family == AF_INET6)
|
||||
//{
|
||||
// const sockaddr_in6* addr = reinterpret_cast<const sockaddr_in6*>(pIface->ifa_addr);));
|
||||
//}
|
||||
}
|
||||
freeifaddrs(ifaces_list);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
13
dll/wrap.cpp
13
dll/wrap.cpp
|
@ -15,19 +15,12 @@
|
|||
License along with the Goldberg Emulator; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#if defined(WIN64) || defined(_WIN64) || defined(__MINGW64__)
|
||||
#define __WINDOWS_64__
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__MINGW32__)
|
||||
#define __WINDOWS_32__
|
||||
#endif
|
||||
|
||||
#if defined(__WINDOWS_32__) || defined(__WINDOWS_64__)
|
||||
// Nothing to be done here
|
||||
#else
|
||||
#define STEAM_API_FUNCTIONS_IMPL
|
||||
#include "base.h"
|
||||
#include "dll.h"
|
||||
|
||||
#if defined(__LINUX__)
|
||||
#define STEAM_API_FUNCTIONS_IMPL
|
||||
|
||||
#define PATH_SEPARATOR_CHAR '/'
|
||||
#define STEAM_PATH_CACHE_SIZE 4096
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#include <list>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <json/json.hpp>
|
||||
#include <json/fifo_map.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <nlohmann/fifo_map.hpp>
|
||||
|
||||
class CurlGlobal
|
||||
{
|
||||
|
@ -246,7 +246,7 @@ static bool create_directory(std::string const& strPath)
|
|||
|
||||
return CreateDirectoryA(strPath.c_str(), NULL);
|
||||
}
|
||||
#elif defined(__linux__)
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
28581
glew/glew.c
28581
glew/glew.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
23686
glew/include/GL/glew.h
23686
glew/include/GL/glew.h
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,547 +0,0 @@
|
|||
/*
|
||||
The code is licensed under the MIT License <http://opensource.org/licenses/MIT>:
|
||||
|
||||
Copyright (c) 2015-2017 Niels Lohmann.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef NLOHMANN_FIFO_MAP_HPP
|
||||
#define NLOHMANN_FIFO_MAP_HPP
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
/*!
|
||||
@brief namespace for Niels Lohmann
|
||||
@see https://github.com/nlohmann
|
||||
*/
|
||||
namespace nlohmann
|
||||
{
|
||||
|
||||
template<class Key>
|
||||
class fifo_map_compare
|
||||
{
|
||||
public:
|
||||
/// constructor given a pointer to a key storage
|
||||
fifo_map_compare(
|
||||
std::unordered_map<Key, std::size_t>* keys,
|
||||
std::size_t timestamp = 1)
|
||||
:
|
||||
m_timestamp(timestamp),
|
||||
m_keys(keys)
|
||||
{}
|
||||
|
||||
/*!
|
||||
This function compares two keys with respect to the order in which they
|
||||
were added to the container. For this, the mapping keys is used.
|
||||
*/
|
||||
bool operator()(const Key& lhs, const Key& rhs) const
|
||||
{
|
||||
// look up timestamps for both keys
|
||||
const auto timestamp_lhs = m_keys->find(lhs);
|
||||
const auto timestamp_rhs = m_keys->find(rhs);
|
||||
|
||||
if (timestamp_lhs == m_keys->end())
|
||||
{
|
||||
// timestamp for lhs not found - cannot be smaller than for rhs
|
||||
return false;
|
||||
}
|
||||
|
||||
if (timestamp_rhs == m_keys->end())
|
||||
{
|
||||
// timestamp for rhs not found - timestamp for lhs is smaller
|
||||
return true;
|
||||
}
|
||||
|
||||
// compare timestamps
|
||||
return timestamp_lhs->second < timestamp_rhs->second;
|
||||
}
|
||||
|
||||
void add_key(const Key& key)
|
||||
{
|
||||
m_keys->insert({key, m_timestamp++});
|
||||
}
|
||||
|
||||
void remove_key(const Key& key)
|
||||
{
|
||||
m_keys->erase(key);
|
||||
}
|
||||
|
||||
private:
|
||||
/// helper to access m_timestamp from fifo_map copy ctor,
|
||||
/// must have same number of template args as fifo_map
|
||||
template <
|
||||
class MapKey,
|
||||
class MapT,
|
||||
class MapCompare,
|
||||
class MapAllocator
|
||||
> friend class fifo_map;
|
||||
|
||||
private:
|
||||
/// the next valid insertion timestamp
|
||||
std::size_t m_timestamp = 1;
|
||||
|
||||
/// pointer to a mapping from keys to insertion timestamps
|
||||
std::unordered_map<Key, std::size_t>* m_keys = nullptr;
|
||||
};
|
||||
|
||||
|
||||
template <
|
||||
class Key,
|
||||
class T,
|
||||
class Compare = fifo_map_compare<Key>,
|
||||
class Allocator = std::allocator<std::pair<const Key, T>>
|
||||
> class fifo_map
|
||||
{
|
||||
public:
|
||||
using key_type = Key;
|
||||
using mapped_type = T;
|
||||
using value_type = std::pair<const Key, T>;
|
||||
using size_type = std::size_t;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using key_compare = Compare;
|
||||
using allocator_type = Allocator;
|
||||
using reference = value_type&;
|
||||
using const_reference = const value_type&;
|
||||
using pointer = typename std::allocator_traits<Allocator>::pointer;
|
||||
using const_pointer = typename std::allocator_traits<Allocator>::const_pointer;
|
||||
|
||||
using internal_map_type = std::map<Key, T, Compare, Allocator>;
|
||||
|
||||
using iterator = typename internal_map_type::iterator;
|
||||
using const_iterator = typename internal_map_type::const_iterator;
|
||||
using reverse_iterator = typename internal_map_type::reverse_iterator;
|
||||
using const_reverse_iterator = typename internal_map_type::const_reverse_iterator;
|
||||
|
||||
public:
|
||||
/// default constructor
|
||||
fifo_map() : m_keys(), m_compare(&m_keys), m_map(m_compare) {}
|
||||
|
||||
/// copy constructor
|
||||
fifo_map(const fifo_map &f) : m_keys(f.m_keys), m_compare(&m_keys, f.m_compare.m_timestamp), m_map(f.m_map.begin(), f.m_map.end(), m_compare) {}
|
||||
|
||||
/// constructor for a range of elements
|
||||
template<class InputIterator>
|
||||
fifo_map(InputIterator first, InputIterator last)
|
||||
: m_keys(), m_compare(&m_keys), m_map(m_compare)
|
||||
{
|
||||
for (auto it = first; it != last; ++it)
|
||||
{
|
||||
insert(*it);
|
||||
}
|
||||
}
|
||||
|
||||
/// constructor for a list of elements
|
||||
fifo_map(std::initializer_list<value_type> init) : fifo_map()
|
||||
{
|
||||
for (auto x : init)
|
||||
{
|
||||
insert(x);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Element access
|
||||
*/
|
||||
|
||||
/// access specified element with bounds checking
|
||||
T& at(const Key& key)
|
||||
{
|
||||
return m_map.at(key);
|
||||
}
|
||||
|
||||
/// access specified element with bounds checking
|
||||
const T& at(const Key& key) const
|
||||
{
|
||||
return m_map.at(key);
|
||||
}
|
||||
|
||||
/// access specified element
|
||||
T& operator[](const Key& key)
|
||||
{
|
||||
m_compare.add_key(key);
|
||||
return m_map[key];
|
||||
}
|
||||
|
||||
/// access specified element
|
||||
T& operator[](Key&& key)
|
||||
{
|
||||
m_compare.add_key(key);
|
||||
return m_map[key];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Iterators
|
||||
*/
|
||||
|
||||
/// returns an iterator to the beginning
|
||||
iterator begin() noexcept
|
||||
{
|
||||
return m_map.begin();
|
||||
}
|
||||
|
||||
/// returns an iterator to the end
|
||||
iterator end() noexcept
|
||||
{
|
||||
return m_map.end();
|
||||
}
|
||||
|
||||
/// returns an iterator to the beginning
|
||||
const_iterator begin() const noexcept
|
||||
{
|
||||
return m_map.begin();
|
||||
}
|
||||
|
||||
/// returns an iterator to the end
|
||||
const_iterator end() const noexcept
|
||||
{
|
||||
return m_map.end();
|
||||
}
|
||||
|
||||
/// returns an iterator to the beginning
|
||||
const_iterator cbegin() const noexcept
|
||||
{
|
||||
return m_map.cbegin();
|
||||
}
|
||||
|
||||
/// returns an iterator to the end
|
||||
const_iterator cend() const noexcept
|
||||
{
|
||||
return m_map.cend();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the beginning
|
||||
reverse_iterator rbegin() noexcept
|
||||
{
|
||||
return m_map.rbegin();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the end
|
||||
reverse_iterator rend() noexcept
|
||||
{
|
||||
return m_map.rend();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the beginning
|
||||
const_reverse_iterator rbegin() const noexcept
|
||||
{
|
||||
return m_map.rbegin();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the end
|
||||
const_reverse_iterator rend() const noexcept
|
||||
{
|
||||
return m_map.rend();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the beginning
|
||||
const_reverse_iterator crbegin() const noexcept
|
||||
{
|
||||
return m_map.crbegin();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the end
|
||||
const_reverse_iterator crend() const noexcept
|
||||
{
|
||||
return m_map.crend();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Capacity
|
||||
*/
|
||||
|
||||
/// checks whether the container is empty
|
||||
bool empty() const noexcept
|
||||
{
|
||||
return m_map.empty();
|
||||
}
|
||||
|
||||
/// returns the number of elements
|
||||
size_type size() const noexcept
|
||||
{
|
||||
return m_map.size();
|
||||
}
|
||||
|
||||
/// returns the maximum possible number of elements
|
||||
size_type max_size() const noexcept
|
||||
{
|
||||
return m_map.max_size();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Modifiers
|
||||
*/
|
||||
|
||||
/// clears the contents
|
||||
void clear() noexcept
|
||||
{
|
||||
m_map.clear();
|
||||
m_keys.clear();
|
||||
}
|
||||
|
||||
/// insert value
|
||||
std::pair<iterator, bool> insert(const value_type& value)
|
||||
{
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.insert(value);
|
||||
}
|
||||
|
||||
/// insert value
|
||||
template<class P>
|
||||
std::pair<iterator, bool> insert( P&& value )
|
||||
{
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.insert(value);
|
||||
}
|
||||
|
||||
/// insert value with hint
|
||||
iterator insert(const_iterator hint, const value_type& value)
|
||||
{
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.insert(hint, value);
|
||||
}
|
||||
|
||||
/// insert value with hint
|
||||
iterator insert(const_iterator hint, value_type&& value)
|
||||
{
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.insert(hint, value);
|
||||
}
|
||||
|
||||
/// insert value range
|
||||
template<class InputIt>
|
||||
void insert(InputIt first, InputIt last)
|
||||
{
|
||||
for (const_iterator it = first; it != last; ++it)
|
||||
{
|
||||
m_compare.add_key(it->first);
|
||||
}
|
||||
|
||||
m_map.insert(first, last);
|
||||
}
|
||||
|
||||
/// insert value list
|
||||
void insert(std::initializer_list<value_type> ilist)
|
||||
{
|
||||
for (auto value : ilist)
|
||||
{
|
||||
m_compare.add_key(value.first);
|
||||
}
|
||||
|
||||
m_map.insert(ilist);
|
||||
}
|
||||
|
||||
/// constructs element in-place
|
||||
template<class... Args>
|
||||
std::pair<iterator, bool> emplace(Args&& ... args)
|
||||
{
|
||||
typename fifo_map::value_type value(std::forward<Args>(args)...);
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.emplace(std::move(value));
|
||||
}
|
||||
|
||||
/// constructs element in-place with hint
|
||||
template<class... Args>
|
||||
iterator emplace_hint(const_iterator hint, Args&& ... args)
|
||||
{
|
||||
typename fifo_map::value_type value(std::forward<Args>(args)...);
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.emplace_hint(hint, std::move(value));
|
||||
}
|
||||
|
||||
/// remove element at position
|
||||
iterator erase(const_iterator pos)
|
||||
{
|
||||
m_compare.remove_key(pos->first);
|
||||
return m_map.erase(pos);
|
||||
}
|
||||
|
||||
/// remove elements in range
|
||||
iterator erase(const_iterator first, const_iterator last)
|
||||
{
|
||||
for (const_iterator it = first; it != last; ++it)
|
||||
{
|
||||
m_compare.remove_key(it->first);
|
||||
}
|
||||
|
||||
return m_map.erase(first, last);
|
||||
}
|
||||
|
||||
/// remove elements with key
|
||||
size_type erase(const key_type& key)
|
||||
{
|
||||
size_type res = m_map.erase(key);
|
||||
|
||||
if (res > 0)
|
||||
{
|
||||
m_compare.remove_key(key);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/// swaps the contents
|
||||
void swap(fifo_map& other)
|
||||
{
|
||||
std::swap(m_map, other.m_map);
|
||||
std::swap(m_compare, other.m_compare);
|
||||
std::swap(m_keys, other.m_keys);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Lookup
|
||||
*/
|
||||
|
||||
/// returns the number of elements matching specific key
|
||||
size_type count(const Key& key) const
|
||||
{
|
||||
return m_map.count(key);
|
||||
}
|
||||
|
||||
/// finds element with specific key
|
||||
iterator find(const Key& key)
|
||||
{
|
||||
return m_map.find(key);
|
||||
}
|
||||
|
||||
/// finds element with specific key
|
||||
const_iterator find(const Key& key) const
|
||||
{
|
||||
return m_map.find(key);
|
||||
}
|
||||
|
||||
/// returns range of elements matching a specific key
|
||||
std::pair<iterator, iterator> equal_range(const Key& key)
|
||||
{
|
||||
return m_map.equal_range(key);
|
||||
}
|
||||
|
||||
/// returns range of elements matching a specific key
|
||||
std::pair<const_iterator, const_iterator> equal_range(const Key& key) const
|
||||
{
|
||||
return m_map.equal_range(key);
|
||||
}
|
||||
|
||||
/// returns an iterator to the first element not less than the given key
|
||||
iterator lower_bound(const Key& key)
|
||||
{
|
||||
return m_map.lower_bound(key);
|
||||
}
|
||||
|
||||
/// returns an iterator to the first element not less than the given key
|
||||
const_iterator lower_bound(const Key& key) const
|
||||
{
|
||||
return m_map.lower_bound(key);
|
||||
}
|
||||
|
||||
/// returns an iterator to the first element greater than the given key
|
||||
iterator upper_bound(const Key& key)
|
||||
{
|
||||
return m_map.upper_bound(key);
|
||||
}
|
||||
|
||||
/// returns an iterator to the first element greater than the given key
|
||||
const_iterator upper_bound(const Key& key) const
|
||||
{
|
||||
return m_map.upper_bound(key);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Observers
|
||||
*/
|
||||
|
||||
/// returns the function that compares keys
|
||||
key_compare key_comp() const
|
||||
{
|
||||
return m_compare;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Non-member functions
|
||||
*/
|
||||
|
||||
friend bool operator==(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map == rhs.m_map;
|
||||
}
|
||||
|
||||
friend bool operator!=(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map != rhs.m_map;
|
||||
}
|
||||
|
||||
friend bool operator<(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map < rhs.m_map;
|
||||
}
|
||||
|
||||
friend bool operator<=(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map <= rhs.m_map;
|
||||
}
|
||||
|
||||
friend bool operator>(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map > rhs.m_map;
|
||||
}
|
||||
|
||||
friend bool operator>=(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map >= rhs.m_map;
|
||||
}
|
||||
|
||||
private:
|
||||
/// the keys
|
||||
std::unordered_map<Key, std::size_t> m_keys;
|
||||
/// the comparison object
|
||||
Compare m_compare;
|
||||
/// the internal data structure
|
||||
internal_map_type m_map;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// specialization of std::swap
|
||||
namespace std
|
||||
{
|
||||
template <class Key, class T, class Compare, class Allocator>
|
||||
inline void swap(nlohmann::fifo_map<Key, T, Compare, Allocator>& m1,
|
||||
nlohmann::fifo_map<Key, T, Compare, Allocator>& m2)
|
||||
{
|
||||
m1.swap(m2);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
20842
json/json.hpp
20842
json/json.hpp
File diff suppressed because it is too large
Load Diff
|
@ -182,7 +182,7 @@ public:
|
|||
void OpenOverlayInvite(CSteamID lobbyId) {}
|
||||
void OpenOverlay(const char* pchDialog) {}
|
||||
|
||||
bool ShowOverlay() const {}
|
||||
bool ShowOverlay() const { return false; }
|
||||
void ShowOverlay(bool state) {}
|
||||
|
||||
void SetLobbyInvite(Friend friendId, uint64 lobbyId) {}
|
||||
|
|
37
stb/LICENCE
37
stb/LICENCE
|
@ -1,37 +0,0 @@
|
|||
This software is available under 2 licenses -- choose whichever you prefer.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE A - MIT License
|
||||
Copyright (c) 2017 Sean Barrett
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE B - Public Domain (www.unlicense.org)
|
||||
This is free and unencumbered software released into the public domain.
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
commercial or non-commercial, and by any means.
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
this software under copyright law.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
7762
stb/stb_image.h
7762
stb/stb_image.h
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
|
||||
set(VCPKG_BUILD_TYPE release)
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
|
|
@ -0,0 +1,16 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
|
||||
set(VCPKG_BUILD_TYPE release)
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
|
||||
|
||||
set(ENV{OSXCROSS_HOST} "x86_64-apple-$ENV{OSXCROSS_TARGET}")
|
||||
|
||||
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE /osxcross/target/toolchain.cmake)
|
||||
|
||||
set(ENV{VCPKG_TOOLCHAIN} "/vcpkg/scripts/toolchains/osx.cmake")
|
||||
|
||||
set(VCPKG_C_FLAGS "-stdlib=libc++")
|
||||
set(VCPKG_CXX_FLAGS "-stdlib=libc++")
|
|
@ -0,0 +1,11 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
set(VCPKG_CRT_LINKAGE static)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
|
||||
set(VCPKG_BUILD_TYPE release)
|
||||
|
||||
set(ENV{HOST_ARCH} ${VCPKG_TARGET_ARCHITECTURE})
|
||||
|
||||
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE /clang_windows_sdk/clang-cl-msvc.cmake)
|
||||
|
||||
set(ENV{VCPKG_TOOLCHAIN} "/vcpkg/scripts/toolchains/windows.cmake")
|
|
@ -0,0 +1,7 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x86)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
|
||||
set(VCPKG_BUILD_TYPE release)
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
|
|
@ -0,0 +1,16 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x86)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
|
||||
set(VCPKG_BUILD_TYPE release)
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
|
||||
|
||||
set(ENV{OSXCROSS_HOST} "i386-apple-$ENV{OSXCROSS_TARGET}")
|
||||
|
||||
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE /osxcross/target/toolchain.cmake)
|
||||
|
||||
set(ENV{VCPKG_TOOLCHAIN} "/vcpkg/scripts/toolchains/osx.cmake")
|
||||
|
||||
set(VCPKG_C_FLAGS "-stdlib=libc++")
|
||||
set(VCPKG_CXX_FLAGS "-stdlib=libc++")
|
|
@ -0,0 +1,11 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x86)
|
||||
set(VCPKG_CRT_LINKAGE static)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
|
||||
set(VCPKG_BUILD_TYPE release)
|
||||
|
||||
set(ENV{HOST_ARCH} ${VCPKG_TARGET_ARCHITECTURE})
|
||||
|
||||
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE /clang_windows_sdk/clang-cl-msvc.cmake)
|
||||
|
||||
set(ENV{VCPKG_TOOLCHAIN} "/vcpkg/scripts/toolchains/windows.cmake")
|
Loading…
Reference in New Issue