2018-09-02 12:48:43 -04:00
|
|
|
include_directories(. util)
|
2018-07-20 15:10:34 -04:00
|
|
|
|
2018-08-19 00:13:19 -04:00
|
|
|
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
2018-08-07 15:44:13 -04:00
|
|
|
set(vnrhook_src
|
2018-08-23 11:53:23 -04:00
|
|
|
main.cc
|
|
|
|
pipe.cc
|
|
|
|
util/ithsys/ithsys.cc
|
|
|
|
hijack/texthook.cc
|
2018-08-07 15:44:13 -04:00
|
|
|
)
|
2018-08-19 00:13:19 -04:00
|
|
|
else()
|
2016-01-06 00:01:17 +09:00
|
|
|
set(vnrhook_src
|
2018-08-23 11:53:23 -04:00
|
|
|
main.cc
|
|
|
|
pipe.cc
|
|
|
|
engine/engine.cc
|
|
|
|
engine/match.cc
|
|
|
|
engine/pchooks.cc
|
|
|
|
hijack/texthook.cc
|
|
|
|
util/util.cc
|
|
|
|
util/ithsys/ithsys.cc
|
|
|
|
util/disasm/disasm.cc
|
|
|
|
util/memdbg/memsearch.cc
|
2016-01-06 00:01:17 +09:00
|
|
|
)
|
2018-08-19 00:13:19 -04:00
|
|
|
endif()
|
2016-01-06 00:01:17 +09:00
|
|
|
|
2018-09-02 12:48:43 -04:00
|
|
|
add_subdirectory(libminhook)
|
2018-07-20 17:50:19 -04:00
|
|
|
|
2016-01-06 00:01:17 +09:00
|
|
|
add_library(vnrhook SHARED ${vnrhook_src})
|
|
|
|
|
|
|
|
enable_language(ASM_MASM)
|
|
|
|
|
|
|
|
set_source_files_properties(
|
|
|
|
${PROJECT_SOURCE_DIR}/winseh/safeseh.asm
|
|
|
|
PROPERTIES
|
|
|
|
# CMAKE_ASM_MASM_FLAGS /safeseh # CMake bug 14711: http://www.cmake.org/Bug/view.php?id=14711
|
|
|
|
COMPILE_FLAGS /safeseh
|
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties(vnrhook PROPERTIES
|
|
|
|
LINK_FLAGS "/SUBSYSTEM:WINDOWS /MANIFEST:NO"
|
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_options(vnrhook PRIVATE
|
|
|
|
/EHa
|
2018-07-28 22:37:54 -07:00
|
|
|
$<$<CONFIG:Release>:>
|
2016-01-06 00:01:17 +09:00
|
|
|
$<$<CONFIG:Debug>:>
|
|
|
|
)
|
|
|
|
|
|
|
|
set(vnrhook_libs
|
2018-07-21 08:22:32 -07:00
|
|
|
ntdll.lib
|
2016-01-06 00:01:17 +09:00
|
|
|
Version.lib
|
2018-08-24 11:33:01 -04:00
|
|
|
minhook
|
2016-01-06 00:01:17 +09:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(vnrhook ${vnrhook_libs})
|
|
|
|
|
|
|
|
target_compile_definitions(vnrhook
|
|
|
|
PRIVATE
|
|
|
|
ITH_HAS_CRT
|
|
|
|
ITH_HAS_SEH
|
|
|
|
_CRT_NON_CONFORMING_SWPRINTFS
|
2018-07-22 18:33:45 -07:00
|
|
|
)
|