From 8d03e7af61e5ea95edfd1ac134f7c74caa118127 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Fri, 3 May 2024 10:52:54 -0700 Subject: [PATCH] add dfhooks chainloader --- .gitmodules | 3 +++ CMakeLists.txt | 1 + depends/CMakeLists.txt | 3 +++ depends/dfhooks | 1 + library/CMakeLists.txt | 8 ++++---- 5 files changed, 12 insertions(+), 4 deletions(-) create mode 160000 depends/dfhooks diff --git a/.gitmodules b/.gitmodules index c349de288b..5fc4c7b3b8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [submodule "depends/googletest"] path = depends/googletest url = ../../google/googletest.git +[submodule "depends/dfhooks"] + path = depends/dfhooks + url = ../../DFHack/dfhooks diff --git a/CMakeLists.txt b/CMakeLists.txt index 49c1d56e2a..60e4b045de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,6 +181,7 @@ endif() # make sure all the necessary submodules have been set up if(NOT EXISTS ${dfhack_SOURCE_DIR}/library/xml/codegen.pl OR NOT EXISTS ${dfhack_SOURCE_DIR}/scripts/CMakeLists.txt + OR NOT EXISTS ${dfhack_SOURCE_DIR}/depends/dfhooks/CMakeLists.txt OR NOT EXISTS ${dfhack_SOURCE_DIR}/depends/clsocket/CMakeLists.txt OR NOT EXISTS ${dfhack_SOURCE_DIR}/depends/jsoncpp-sub/CMakeLists.txt OR NOT EXISTS ${dfhack_SOURCE_DIR}/depends/libexpat/expat/CMakeLists.txt diff --git a/depends/CMakeLists.txt b/depends/CMakeLists.txt index 536eba63aa..9dd3ac7e10 100644 --- a/depends/CMakeLists.txt +++ b/depends/CMakeLists.txt @@ -1,4 +1,7 @@ # list depends here. +add_subdirectory(dfhooks) +install(TARGETS dfhooks LIBRARY DESTINATION . RUNTIME DESTINATION .) + add_subdirectory(lodepng) add_subdirectory(lua) add_subdirectory(md5) diff --git a/depends/dfhooks b/depends/dfhooks new file mode 160000 index 0000000000..43369ff7b6 --- /dev/null +++ b/depends/dfhooks @@ -0,0 +1 @@ +Subproject commit 43369ff7b676a163770077ba6e56403b04606548 diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index a668a07731..58e907678f 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -375,14 +375,14 @@ add_executable(binpatch binpatch.cpp) target_link_libraries(binpatch dfhack-md5) if(WIN32) - set_target_properties(dfhack PROPERTIES OUTPUT_NAME "dfhooks" ) + set_target_properties(dfhack PROPERTIES OUTPUT_NAME "dfhooks_dfhack" ) set_target_properties(dfhack PROPERTIES COMPILE_FLAGS "/FI\"Export.h\"" ) set_target_properties(dfhack-client PROPERTIES COMPILE_FLAGS "/FI\"Export.h\"" ) else() set_target_properties(dfhack PROPERTIES COMPILE_FLAGS "-include Export.h" ) set_target_properties(dfhack-client PROPERTIES COMPILE_FLAGS "-include Export.h" ) - add_library(dfhooks SHARED Hooks.cpp) - target_link_libraries(dfhooks dfhack) + add_library(dfhooks_dfhack SHARED Hooks.cpp) + target_link_libraries(dfhooks_dfhack dfhack) endif() # effectively disables debug builds... @@ -431,7 +431,7 @@ if(UNIX) install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/dfhack-run DESTINATION .) endif() - install(TARGETS dfhooks + install(TARGETS dfhooks_dfhack LIBRARY DESTINATION . RUNTIME DESTINATION .) endif()