2021-11-07 20:54:34 +08:00
|
|
|
include_directories(. util minhook/include)
|
2018-07-21 03:10:34 +08:00
|
|
|
|
2019-02-16 16:17:16 +08:00
|
|
|
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
2021-11-07 20:54:34 +08:00
|
|
|
set(minhook_src
|
|
|
|
minhook/src/buffer.c
|
|
|
|
minhook/src/hook.c
|
|
|
|
minhook/src/trampoline.c
|
|
|
|
minhook/src/hde/hde64.c
|
|
|
|
)
|
|
|
|
set(texthook_src
|
|
|
|
main.cc
|
|
|
|
texthook.cc
|
|
|
|
hookfinder.cc
|
|
|
|
engine/match.cc
|
|
|
|
engine/match64.cc
|
|
|
|
engine/native/pchooks.cc
|
|
|
|
util/ithsys/ithsys.cc
|
|
|
|
util/util.cc
|
|
|
|
)
|
2018-08-19 12:13:19 +08:00
|
|
|
else()
|
2021-11-07 20:54:34 +08:00
|
|
|
set(minhook_src
|
|
|
|
minhook/src/buffer.c
|
|
|
|
minhook/src/hook.c
|
|
|
|
minhook/src/trampoline.c
|
|
|
|
minhook/src/hde/hde32.c
|
|
|
|
)
|
|
|
|
set(texthook_src
|
|
|
|
main.cc
|
|
|
|
texthook.cc
|
|
|
|
hookfinder.cc
|
|
|
|
engine/engine.cc
|
|
|
|
engine/match.cc
|
|
|
|
engine/match32.cc
|
|
|
|
engine/native/pchooks.cc
|
|
|
|
util/util.cc
|
|
|
|
util/ithsys/ithsys.cc
|
|
|
|
util/disasm/disasm.cc
|
|
|
|
util/memdbg/memsearch.cc
|
|
|
|
)
|
2018-08-19 12:13:19 +08:00
|
|
|
endif()
|
2016-01-05 23:01:17 +08:00
|
|
|
|
2021-11-07 20:54:34 +08:00
|
|
|
add_library(minhook ${minhook_src})
|
2019-06-11 01:58:19 +08:00
|
|
|
add_library(texthook MODULE ${texthook_src})
|
2021-11-08 22:07:34 +08:00
|
|
|
# isn't there a better way to do this?
|
2021-11-07 20:54:34 +08:00
|
|
|
target_precompile_headers(texthook PRIVATE ../include/common.h)
|
2021-11-08 22:07:34 +08:00
|
|
|
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
2021-11-07 20:54:34 +08:00
|
|
|
target_compile_options(minhook PRIVATE /MT)
|
|
|
|
target_compile_options(texthook PRIVATE /MT)
|
|
|
|
target_link_options(texthook PRIVATE /NODEFAULTLIB:MSVCRT)
|
|
|
|
endif()
|
2019-06-02 14:09:17 +08:00
|
|
|
target_link_libraries(texthook minhook)
|