mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
Refactor: add spdlog vendored headers, Logger wrapper and libloader module skeleton
This commit is contained in:
1 parent
d711838948
commit
01f966c5f2
110 files changed
+27123
No files matched your search
@@ -0,0 +1,25 @@
|
||||
file(GLOB_RECURSE loader_sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/common/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/common/*.c
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
message(STATUS "Detected System: Windows")
|
||||
|
||||
file(GLOB_RECURSE windows_sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/plantform/windows/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/plantform/windows/*.c
|
||||
)
|
||||
|
||||
list(APPEND loader_sources ${windows_sources})
|
||||
endif()
|
||||
|
||||
add_library(loader SHARED ${loader_sources})
|
||||
|
||||
target_include_directories(loader PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/includes
|
||||
)
|
||||
|
||||
target_link_libraries(loader PRIVATE
|
||||
jvm
|
||||
)
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include "JuiceAgent/Logger.hpp"
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
|
||||
switch (fdwReason) {
|
||||
case DLL_PROCESS_ATTACH: {
|
||||
DisableThreadLibraryCalls(hinstDLL);
|
||||
Logger::init("libloader.log");
|
||||
|
||||
spdlog::info("DllMain: DLL_PROCESS_ATTACH");
|
||||
break;
|
||||
}
|
||||
|
||||
case DLL_THREAD_ATTACH: {
|
||||
break;
|
||||
}
|
||||
|
||||
case DLL_THREAD_DETACH: {
|
||||
break;
|
||||
}
|
||||
|
||||
case DLL_PROCESS_DETACH: {
|
||||
spdlog::info("DllMain: DLL_PROCESS_DETACH");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
Reference in new issue
Block a user