From d71b1fbe38fae28555e04ff263a4359b3465618b Mon Sep 17 00:00:00 2001 From: Saty <5752427+SatyPardus@users.noreply.github.com> Date: Fri, 2 Oct 2026 06:33:43 +0200 Subject: [PATCH] WowClient: output name override, stand-in link launcher, continue option - WOWCLIENT_OUTPUT_OVERRIDE names the executable (Waystone / WaystoneDev from re/tools/build) - WOWCLIENT_STANDIN_LINKER runs a link launcher that turns unresolved symbols into stand-ins (Ninja / Visual Studio CMake builds) - WOWCLIENT_STANDIN_CONTINUE compiles the stand-in runtime to log and continue by default - Ignore out/ and the local CMakeSettings.json Co-Authored-By: Claude Opus 5.5 (1M context) --- .gitignore | 4 ++++ Tools/WowClient/CMakeLists.txt | 21 +++++++++++++++++++++ Tools/WowClient/standin_runtime.cpp | 4 ++++ 3 files changed, 29 insertions(+) diff --git a/.gitignore b/.gitignore index c32f22c..68f8581 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ bld/ [Oo]bj/ [Ll]og/ [Ll]ogs/ +[Oo]ut/ # Visual Studio 2015/2017 cache/options directory .vs/ @@ -406,3 +407,6 @@ FodyWeavers.xsd !Engine/Source/BlizzardCore/Source/System/Debug/ !Engine/Source/BlizzardCore/Source/System/Log/ !ThirdParty/nvapi/x86/ + +# Local Visual Studio CMake settings (absolute paths to re/tools) +CMakeSettings.json diff --git a/Tools/WowClient/CMakeLists.txt b/Tools/WowClient/CMakeLists.txt index d590c44..3025746 100644 --- a/Tools/WowClient/CMakeLists.txt +++ b/Tools/WowClient/CMakeLists.txt @@ -8,6 +8,11 @@ else () set(WOWCLIENT_OUTPUT_NAME WowClient32) endif () +set(WOWCLIENT_OUTPUT_OVERRIDE "" CACHE STRING "WowClient executable name instead of WowClient64/WowClient32 (re/tools/build sets Waystone / WaystoneDev)") +if (WOWCLIENT_OUTPUT_OVERRIDE) + set(WOWCLIENT_OUTPUT_NAME ${WOWCLIENT_OUTPUT_OVERRIDE}) +endif () + set(STANDINS_GENERATED "${CMAKE_CURRENT_BINARY_DIR}/standins_generated.cpp") if (NOT EXISTS "${STANDINS_GENERATED}") file(WRITE "${STANDINS_GENERATED}" "extern \"C\" const char* const g_standinNames[] = { \"\" };\nextern \"C\" const int g_standinCount = 0;\n") @@ -32,6 +37,22 @@ target_include_directories(WowClient target_link_options(WowClient PRIVATE "/INCREMENTAL:NO" "/ENTRY:start") +set(WOWCLIENT_STANDIN_LINKER "" CACHE FILEPATH "Link launcher that turns unresolved symbols into stand-ins (re/tools/standin_link.py); Ninja and Makefile generators only") +if (WOWCLIENT_STANDIN_LINKER) + find_package(Python3 COMPONENTS Interpreter REQUIRED) + if (WOWDECOMP_ARCH_32) + set(WOWCLIENT_STANDIN_ARCH win32) + else () + set(WOWCLIENT_STANDIN_ARCH x64) + endif () + set_property(TARGET WowClient PROPERTY RULE_LAUNCH_LINK "\"${Python3_EXECUTABLE}\" \"${WOWCLIENT_STANDIN_LINKER}\" \"${STANDINS_GENERATED}\" ${WOWCLIENT_STANDIN_ARCH} --") +endif () + +option(WOWCLIENT_STANDIN_CONTINUE "Stand-ins log their first hit and return 0 instead of exiting the client" OFF) +if (WOWCLIENT_STANDIN_CONTINUE) + set_source_files_properties(standin_runtime.cpp PROPERTIES COMPILE_DEFINITIONS WOWCLIENT_STANDIN_CONTINUE_DEFAULT) +endif () + target_link_libraries(WowClient PRIVATE BLPFile diff --git a/Tools/WowClient/standin_runtime.cpp b/Tools/WowClient/standin_runtime.cpp index cd7a5f1..788f794 100644 --- a/Tools/WowClient/standin_runtime.cpp +++ b/Tools/WowClient/standin_runtime.cpp @@ -114,7 +114,11 @@ extern "C" double StandinReport(int index, void* returnAddress) { static int s_continue = -1; if (s_continue < 0) { +#ifdef WOWCLIENT_STANDIN_CONTINUE_DEFAULT + s_continue = 1; +#else s_continue = GetEnvironmentVariableA("WOWCLIENT_STANDIN_CONTINUE", nullptr, 0) ? 1 : 0; +#endif } if (!s_continue) {