Skip to content

Commit c7e27cd

Browse files
committed
Fix Build: Using reliable Detours lookup and fixed parameter names
1 parent 2f4414d commit c7e27cd

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ project(Chain_of_Trust VERSION 1.0.0 LANGUAGES C CXX ASM)
44
option(BUILD_KERNEL "Build kernel driver" ON)
55
option(BUILD_TESTS "Build tests" ON)
66

7-
find_package(Detours CONFIG REQUIRED)
7+
# Detours often doesn't provide a CMake config in some vcpkg versions
8+
find_path(DETOURS_INCLUDE_DIRS "detours/detours.h")
9+
find_library(DETOURS_LIBRARY detours REQUIRED)
10+
811
find_package(GTest CONFIG REQUIRED)
912

1013
add_subdirectory(src/edr_agent)
@@ -15,4 +18,4 @@ endif()
1518
if(BUILD_TESTS)
1619
enable_testing()
1720
add_subdirectory(tests)
18-
endif()
21+
endif()

src/edr_agent/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
add_executable(EDRAgent main.cpp)
2-
target_link_libraries(EDRAgent PRIVATE Detours::Detours common)
2+
target_include_directories(EDRAgent PRIVATE ${DETOURS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/src/common)
3+
target_link_libraries(EDRAgent PRIVATE ${DETOURS_LIBRARY} common)

src/edr_agent/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ int wmain(int argc, wchar_t* argv[]) {
2727
g_running = false;
2828
mon.join();
2929
return 0;
30-
}
30+
}
31+

0 commit comments

Comments
 (0)