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/ ACP_Ray2/
build/ build/
build_msvc/
# game_re/ # game_re/
windows_libs/ windows_libs/
tooling/build/ tooling/build/

View File

@ -86,6 +86,20 @@ function(setup_target TARGET DBG_MODE)
DbgHelp 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() else()
target_sources(${TARGET} PRIVATE target_sources(${TARGET} PRIVATE
r3/binders/static_mem.cxx r3/binders/static_mem.cxx

View File

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