generated from LiteLDev/liteloaderbds-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
76 lines (65 loc) · 1.41 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
cmake_minimum_required(VERSION 3.21)
project(plugin)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_BUILD_TYPE Release)
file(GLOB_RECURSE SRC_FILES_DIR
${PROJECT_SOURCE_DIR}/src/*.c
${PROJECT_SOURCE_DIR}/src/*.cpp
${PROJECT_SOURCE_DIR}/src/*.h
)
include_directories(
${CMAKE_SOURCE_DIR}/SDK/include
)
link_directories(
${CMAKE_SOURCE_DIR}/SDK/lib
)
add_definitions(
-D"NDEBUG"
-D"NOMINMAX"
-D"TEMPLATE_EXPORTS"
-D"UNICODE"
-D"WIN32_LEAN_AND_MEAN"
-D"_AMD64_"
-D"_CRT_SECURE_NO_WARNINGS"
-D"_UNICODE"
-D"_USRDLL"
-D"_WINDLL"
-D"_WINDOWS"
)
add_compile_options(
/diagnostics:column
/EHsc
/FC
/GL
/MD
/nologo
/permissive-
/sdl
/utf-8
/Zc:inline
/Zi
)
add_link_options(
/DEBUG
/DELAYLOAD:"bedrock_server.dll"
/DLL
/IGNORE:4199
/INCREMENTAL:NO
/LTCG:INCREMENTAL
/MANIFESTUAC:NO
/MACHINE:X64
/NOLOGO
/OPT:ICF
/OPT:REF
/SUBSYSTEM:CONSOLE
)
add_library(${CMAKE_PROJECT_NAME} SHARED ${SRC_FILES_DIR})
target_link_libraries(${CMAKE_PROJECT_NAME}
"${CMAKE_SOURCE_DIR}/SDK/lib/LiteLoader.lib"
"${CMAKE_SOURCE_DIR}/SDK/lib/bedrock_server_api.lib"
"${CMAKE_SOURCE_DIR}/SDK/lib/bedrock_server_var.lib"
"${CMAKE_SOURCE_DIR}/SDK/lib/SymDBHelper.lib"
)
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} PRE_BUILD
COMMAND cmd /c ${PROJECT_SOURCE_DIR}/prepare_libraries.cmd ${PROJECT_SOURCE_DIR}
)