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) <[email protected]>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user