-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathxmake.lua
125 lines (106 loc) · 2.92 KB
/
xmake.lua
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
add_rules("mode.debug", "mode.release")
add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
add_requires(
"demangler",
"dyncall",
"fmt",
"legacymoney 0.7.0",
"legacyparticleapi 0.7.0",
"legacyremotecall 0.7.0",
"levilamina 0.12.2",
"lightwebsocketclient",
"magic_enum",
"nlohmann_json",
"simpleini",
"sqlite3 3.43.0+200",
"toml++",
"cpp-httplib 0.14.0", {configs={ssl=true, zlib=true}}
)
if is_config("backend", "lua") then
add_requires("scriptx main", {configs={backend="Lua"}})
elseif is_config("backend", "quickjs") then
add_requires("scriptx main", {configs={backend="QuickJs"}})
elseif is_config("backend", "python") then
add_requires("scriptx main", {configs={backend="Python"}})
add_requires("microsoft-detours")
elseif is_config("backend", "nodejs") then
add_requires("scriptx main", {configs={backend="V8"}})
end
if not has_config("vs_runtime") then
set_runtimes("MD")
end
option("backend")
set_default("lua")
set_values("lua", "quickjs", "python", "nodejs")
target("legacy-script-engine")
add_cxflags(
"/EHa",
"/utf-8"
)
add_defines(
"_HAS_CXX23=1",
"NOMINMAX",
"UNICODE",
"_AMD64_"
)
add_files(
"src/**.cpp"
)
add_includedirs(
"src",
"src/legacy"
)
add_packages(
"cpp-httplib",
"demangler",
"dyncall",
"fmt",
"legacymoney",
"legacyparticleapi",
"legacyremotecall",
"levilamina",
"lightwebsocketclient",
"magic_enum",
"nlohmann_json",
"scriptx",
"simpleini",
"sqlite3",
"toml++"
)
add_shflags(
"/DELAYLOAD:bedrock_server.dll"
)
set_exceptions("none")
set_kind("shared")
set_languages("cxx20")
set_symbols("debug")
if is_config("backend", "lua") then
add_defines(
"LEGACY_SCRIPT_ENGINE_BACKEND_LUA"
)
set_basename("legacy-script-engine-lua")
elseif is_config("backend", "quickjs") then
add_defines(
"LEGACY_SCRIPT_ENGINE_BACKEND_QUICKJS"
)
set_basename("legacy-script-engine-quickjs")
elseif is_config("backend", "python") then
add_defines(
"LEGACY_SCRIPT_ENGINE_BACKEND_PYTHON"
)
set_basename("legacy-script-engine-python")
add_packages("microsoft-detours")
elseif is_config("backend", "nodejs") then
add_defines(
"LEGACY_SCRIPT_ENGINE_BACKEND_NODEJS"
)
set_basename("legacy-script-engine-nodejs")
end
after_build(function (target)
local plugin_packer = import("scripts.after_build")
local plugin_define = {
pluginName = target:basename(),
pluginFile = path.filename(target:targetfile()),
}
plugin_packer.pack_plugin(target,plugin_define)
end)