Skip to content

Commit 319979c

Browse files
committed
Update CMake configuration to link NThreadOSUtils as a public dependency and consolidate common definitions for GhostLibs
1 parent fee6043 commit 319979c

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

CMakeLists.txt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,18 @@ add_subdirectory(NThreadOSUtils)
2121

2222
# Create a shared library (DLL) that bundles all submodules.
2323
add_library(GhostLibs SHARED "")
24-
target_link_libraries(GhostLibs PRIVATE NThreadOSUtils)
24+
target_link_libraries(GhostLibs PUBLIC NThreadOSUtils)
25+
26+
set(COMMON_DEFINITIONS
27+
LOG_LEVEL_2
28+
NEPTUNE_MODULERULES_HEADER="ntosutils_rules.h"
29+
NEPTUNE_ENABLE_MEMMEM
30+
VERSION=${PROJECT_VERSION}
31+
LOG_FILE_PATH=L"ghostinjector.log"
32+
LOG_ON_STDOUT=1
33+
)
34+
35+
target_compile_definitions(GhostLibs PRIVATE ${COMMON_DEFINITIONS})
2536

2637
# On Windows, this automatically exports all symbols from the static libs into the DLL.
2738
if(WIN32)
@@ -37,15 +48,8 @@ file(GLOB_RECURSE GHOSTINJECTOR_SOURCES CONFIGURE_DEPENDS ${GHOSTINJECTOR_SOURCE
3748
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
3849
set(EXECUTABLE_NAME "${PROJECT_NAME_LOWER}-${PROJECT_VERSION}")
3950

40-
add_executable(${EXECUTABLE_NAME} ${GHOSTINJECTOR_SOURCES})
51+
add_executable(${EXECUTABLE_NAME} ${GHOSTINJECTOR_SOURCES} ${GHOSTINJECTOR_HEADERS})
4152
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${GHOSTINJECTOR_INCLUDE_DIR})
4253
target_link_libraries(${EXECUTABLE_NAME} PRIVATE GhostLibs)
4354

44-
target_compile_definitions(${EXECUTABLE_NAME} PRIVATE
45-
LOG_LEVEL_2
46-
NEPTUNE_MODULERULES_HEADER="ntosutils_rules.h"
47-
NEPTUNE_ENABLE_MEMMEM
48-
VERSION=${PROJECT_VERSION}
49-
LOG_FILE_PATH=L"ghostinjector.log"
50-
LOG_ON_STDOUT=1
51-
)
55+
target_compile_definitions(${EXECUTABLE_NAME} PRIVATE ${COMMON_DEFINITIONS})

Neptune

0 commit comments

Comments
 (0)