Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/build-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ jobs:
build:
name: ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}
runs-on: windows-2022
timeout-minutes: 30
# A cold vcpkg binary cache builds all dependencies from source.
timeout-minutes: 120

env:
VCPKG_FILE_CACHE: ${{ github.workspace }}\vcpkg-bincache
Expand Down Expand Up @@ -115,6 +116,8 @@ jobs:

$triplet = "x86-windows"
if ("${{ inputs.preset }}" -like "x64*") { $triplet = "x64-windows" }
# Must match VCPKG_TARGET_TRIPLET in the win32-vcpkg presets.
if ("${{ inputs.preset }}" -like "win32-vcpkg*") { $triplet = "x86-windows-static-md" }

"baseline=$baseline" >> $env:GITHUB_OUTPUT
"triplet=$triplet" >> $env:GITHUB_OUTPUT
Expand All @@ -137,6 +140,8 @@ jobs:
with:
runVcpkgInstall: false
doNotCache: true
# Only the root manifest; ports/ holds overlay port manifests without a baseline.
vcpkgJsonGlob: vcpkg.json

- name: Configure vcpkg to use cached directory
if: startsWith(inputs.preset, 'win32')
Expand Down Expand Up @@ -178,7 +183,7 @@ jobs:

- name: Save vcpkg binary cache
# Only one job should save to avoid "Unable to reserve cache" conflicts.
if: ${{ startsWith(inputs.preset, 'win32') && steps.vcpkg_cache.outputs.cache-hit != 'true' && inputs.game == 'Generals' && inputs.preset == 'win32-vcpkg-debug' }}
if: ${{ startsWith(inputs.preset, 'win32') && steps.vcpkg_cache.outputs.cache-hit != 'true' && inputs.game == 'GeneralsMD' && inputs.preset == 'win32-vcpkg' }}
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ github.workspace }}\vcpkg-bincache
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,24 +135,17 @@ jobs:
strategy:
matrix:
include:
- preset: "win32"
# Generals Online networking deps (curl, GameNetworkingSockets, sentry) come from vcpkg,
# so only the vcpkg presets can build GeneralsMD.
- preset: "win32-vcpkg"
tools: false
extras: true
- preset: "win32-profile"
- preset: "win32-vcpkg-profile"
tools: false
extras: true
- preset: "win32-debug"
- preset: "win32-vcpkg-debug"
tools: false
extras: true
#- preset: "win32-vcpkg"
# tools: true
# extras: true
#- preset: "win32-vcpkg-profile"
# tools: true
# extras: true
#- preset: "win32-vcpkg-debug"
# tools: true
# extras: true
fail-fast: false
uses: ./.github/workflows/build-toolchain.yml
with:
Expand Down
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ else()
endif()

include(cmake/config.cmake)

if(RTS_BUILD_ZEROHOUR AND NOT IS_VS6_BUILD)
if(NOT VCPKG_TOOLCHAIN)
message(FATAL_ERROR
"Zero Hour networking dependencies require the vcpkg toolchain. "
"Configure with -DCMAKE_TOOLCHAIN_FILE=<vcpkg>/scripts/buildsystems/vcpkg.cmake.")
endif()
include(cmake/networking.cmake)
endif()

include(cmake/gamespy.cmake)
include(cmake/lzhl.cmake)
include(cmake/stb.cmake)
Expand Down
2 changes: 2 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@
"strategy": "external"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x86-windows-static-md",
"VCPKG_INSTALL_OPTIONS": "--x-buildtrees-root=$env{LOCALAPPDATA}/vcpkg/bt",
"RTS_FLAGS": "/W3"
},
"vendor": {
Expand Down
11 changes: 11 additions & 0 deletions GeneralsMD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ endif()
if(RTS_INSTALL_PREFIX_ZEROHOUR)
install(TARGETS z_generals RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES $<TARGET_PDB_FILE:z_generals> DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL)
if(EXISTS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/sentry-native/crashpad_handler.exe")
# sentry's crashpad backend needs this watcher executable next to the game (see Main/CMakeLists.txt).
install(PROGRAMS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/sentry-native/crashpad_handler.exe"
DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
endif()
if(WIN32)
# discord-rpc.dll is copied next to the build output in Main/CMakeLists.txt.
set(DISCORD_RPC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Code/GameEngine/Source/GameNetwork/GeneralsOnline/Vendor/DiscordRPC")
install(FILES "${DISCORD_RPC_DIR}/discord-rpc.dll" DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES "${DISCORD_RPC_DIR}/LICENSE.txt" DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" RENAME discord-rpc-LICENSE.txt)
endif()

if(TARGET z_worldbuilder)
install(TARGETS z_worldbuilder RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
Expand Down
34 changes: 6 additions & 28 deletions GeneralsMD/Code/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1160,29 +1160,6 @@ set(GAMEENGINE_SRC
Include/GameNetwork/GeneralsOnline/HTTP/HTTPRequest.h
Include/GameNetwork/GeneralsOnline/NextGenTransport.h
Include/GameNetwork/GeneralsOnline/PluginInterfaces.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingmessages.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingsockets.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/isteamnetworkingutils.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steam_api_common.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamclientpublic.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingcustomsignaling.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingsockets.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingsockets_flat.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamnetworkingtypes.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamtypes.h
Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/steam/steamuniverse.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/curl.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/curlver.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/easy.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/header.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/mprintf.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/multi.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/options.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/stdcheaders.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/system.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/typecheck-gcc.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/urlapi.h
Include/GameNetwork/GeneralsOnline/Vendor/libcurl/websockets.h
Source/GameNetwork/GeneralsOnline/DiscordRichPresence.cpp
Source/GameNetwork/GeneralsOnline/NGMP_Helpers.cpp
Source/GameNetwork/GeneralsOnline/NGMPGame.cpp
Expand Down Expand Up @@ -1222,8 +1199,6 @@ add_library(z_gameengine STATIC)

target_sources(z_gameengine PRIVATE ${GAMEENGINE_SRC})

target_compile_definitions(z_gameengine PRIVATE GAMESPY_IMPORT_DATA)

target_include_directories(z_gameengine PUBLIC
Include

Expand All @@ -1244,14 +1219,17 @@ target_link_libraries(z_gameengine PUBLIC
z_wwvegas
)

# Generals Online networking dependencies, provided by vcpkg (see vcpkg.json).
if(NOT IS_VS6_BUILD)
find_package(CURL CONFIG REQUIRED)
find_package(GameNetworkingSockets CONFIG REQUIRED)
find_package(sentry CONFIG REQUIRED)

target_link_libraries(z_gameengine PUBLIC
CURL::libcurl
GameNetworkingSockets::shared
GameNetworkingSockets::GameNetworkingSockets_s
sentry::sentry
)
else()
target_compile_definitions(z_gameengine PRIVATE RTS_USE_LEGACY_NETWORK_VENDOR)
endif()

target_precompile_headers(z_gameengine PRIVATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ class HTTPManager
void Tick();


static void SetCACertStoreBad()
{
m_bCACertBad.store(true);
}

static bool IsCACertStoreBad()
{
return m_bCACertBad.load();
}

void SetProtocolInUse(EIPProtocolVersion proto)
{
m_sProtocolInUse.store(proto);
Expand Down Expand Up @@ -84,8 +74,6 @@ class HTTPManager

std::atomic<EIPProtocolVersion> m_sProtocolInUse = EIPProtocolVersion::DONT_CARE;

static std::atomic<bool> m_bCACertBad;

bool m_bProxyEnabled = false;
std::string m_strProxyAddr;
uint16_t m_proxyPort;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
#pragma once

#define STEAMNETWORKINGSOCKETS_STATIC_LINK 1

#include "GameNetwork/udp.h"
#include "GameNetwork/NetworkDefs.h"
#include "GameNetwork/Transport.h"
#include "../NGMP_include.h"

#include <steam/isteamnetworkingmessages.h>

#ifdef RTS_USE_LEGACY_NETWORK_VENDOR
#pragma comment(lib, "ValveNetworkingSockets/GameNetworkingSockets.lib")
#pragma comment(lib, "ValveNetworkingSockets/abseil_dll.lib")
#pragma comment(lib, "ValveNetworkingSockets/libcrypto.lib")
#pragma comment(lib, "ValveNetworkingSockets/libprotobuf.lib")
#pragma comment(lib, "ValveNetworkingSockets/libssl.lib")
#pragma comment(lib, "ValveNetworkingSockets/steamwebrtc.lib")
#pragma comment(lib, "ValveNetworkingSockets/webrtc-lite.lib")
#endif
#pragma comment(lib, "Secur32.lib")

// Struct to track retry state for outgoing packets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ struct S3ScreenshotEntry
#include <mutex>
#include <atomic>

#ifdef RTS_USE_LEGACY_NETWORK_VENDOR
#pragma comment(lib, "libcurl/libcurl.lib")
#include "GameNetwork/GeneralsOnline/Vendor/libcurl/curl.h"
#else
#include <curl/curl.h>
#endif
#include <sentry.h>
#include <chrono>
#include "GeneralsOnline_Settings.h"
Expand Down
Loading
Loading