-
Notifications
You must be signed in to change notification settings - Fork 88
/
CmakeLists.txt
106 lines (92 loc) · 2.75 KB
/
CmakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
cmake_minimum_required(VERSION 3.21.0)
project(yama CXX)
cmake_policy(SET CMP0091 NEW)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
add_definitions(-v) # verbose logs.
# THE LIST OF SORUCE FILES
# =====================================================
set(hdrs
src/memory.hpp
src/process.hpp
src/thread.hpp
src/yaramanager.hpp
src/typedef.h
src/file.h
src/pid.h
src/resource.h
src/reporter.hpp
src/rc4.hpp
src/suspicious_process.hpp
src/strutils.h
src/privilege.h
src/etw_provider.h
src/scanner_context.hpp
src/yamascanner.hpp
)
set(srcs
src/main.cpp
src/memory.cpp
src/process.cpp
src/thread.cpp
src/yaramanager.cpp
src/file.cpp
src/pid.cpp
src/resource.cpp
src/reporter.cpp
src/rc4.cpp
src/suspicious_process.cpp
src/strutils.cpp
src/privilege.cpp
src/etw_provider.cpp
src/scanner_context.cpp
src/yamascanner.cpp
)
set(rsrc
rsrc/resources.rc
rsrc/resources.h
rsrc/version.h
)
# Add Yama to build targets
# =====================================================
add_executable(yama ${srcs} ${hdrs} ${rsrc})
# Add libyara to build targets
# =====================================================
add_subdirectory(dependencies/yara)
# Add spdlog::spdlog to build targets
# =====================================================
add_subdirectory(dependencies/spdlog)
# Add 3rd-party libraries to include directories
# =====================================================
target_include_directories(yama PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/dependencies/yara/yara/libyara/include
${CMAKE_CURRENT_SOURCE_DIR}/dependencies/argparse/include
${CMAKE_CURRENT_SOURCE_DIR}/dependencies/spdlog/include
${CMAKE_CURRENT_SOURCE_DIR}/dependencies/json/single_include
)
# Set C++ compiler features to Yama
# =====================================================
target_compile_features(yama PUBLIC cxx_std_17)
# Set compiler options for Yama
# =====================================================
target_compile_options(yama PRIVATE
-DUNICODE
-D_CONSOLE
-D_MBCS # support multibyte character set
-D_WINDOWS
-D_WIN32
-Wall
-Wextra
-Wno-missing-field-initializers
-Wno-trigraphs # suppress warnings caused by yaralib
-Wno-unused-parameter # suppress warnings caused by yaralib
)
# Set compiler definitions to pass decrypt key to compiler preprocessor
# =====================================================================
if (DEFINED DECRYPT_KEY)
target_compile_definitions(yama PRIVATE DECRYPT_KEY="${DECRYPT_KEY}")
else()
target_compile_definitions(yama PRIVATE DECRYPT_KEY="YetAnotherMemoryAnalyzer")
endif()
target_link_libraries(yama
libyara
spdlog::spdlog)