Hook setup in cmake

This commit is contained in:
Guus Waals 2025-05-31 23:46:23 +08:00
parent 76915ede69
commit a723dbd2f9
3 changed files with 19 additions and 4 deletions

1
.gitignore vendored
View File

@ -19,6 +19,7 @@ headers
ACP_Ray2/
build/
build_msvc/
# game_re/
windows_libs/
tooling/build/

View File

@ -65,8 +65,8 @@ function(setup_target TARGET DBG_MODE)
# Potentially might want 1/1 translation for code
# For now it has the following values:
# 0 = 100% original (as possible)
# 1 = Runtime QOL (no cd checks, windowed mode, etc.)
# 0 = 100% original (as possible)
# 1 = Runtime QOL (no cd checks, windowed mode, etc.)
target_compile_definitions(${TARGET} PRIVATE
RE_AUTHENTIC=1
)
@ -86,6 +86,20 @@ function(setup_target TARGET DBG_MODE)
DbgHelp
)
find_program(gh_tool
NAMES gh_tool gh_tool.exe
HINTS ${CMAKE_CURRENT_LIST_DIR}/../tooling/bin
REQUIRED
)
execute_process(
COMMAND ${gh_tool} -d${CMAKE_CURRENT_SOURCE_DIR}/gh.db
hooks -o ${CMAKE_CURRENT_BINARY_DIR}/hooks.def
)
target_sources(${TARGET} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/hooks.def
)
else()
target_sources(${TARGET} PRIVATE
r3/binders/static_mem.cxx

View File

@ -19,9 +19,9 @@ mkdir -p bin
# Copy binary to bin folder
# Use .exe extension on Windows, no extension on Unix-like systems
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
cp build/tmp/r3_gh_tool.exe bin/
cp build/tmp/gh_tool.exe bin/
else
cp build/tmp/r3_gh_tool bin/
cp build/tmp/gh_tool bin/
fi
popd