generated from LiteLDev/levilamina-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
xmake.lua
68 lines (61 loc) · 1.74 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
add_rules("mode.release", "mode.debug")
add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
add_requires(
"levilamina 0.13.0",
"parallel-hashmap"
)
if not has_config("vs_runtime") then
set_runtimes("MD")
end
target("LeviOptimize")
add_cxflags(
"/EHa",
"/utf-8",
"/W4",
"/w44265",
"/w44289",
"/w44296",
"/w45263",
"/w44738",
"/w45204"
)
add_defines(
"_HAS_CXX23=1", -- To enable C++23 features
"NOMINMAX", -- To avoid conflicts with std::min and std::max.
"UNICODE" -- To enable Unicode support in Windows API.
)
add_files(
"src/**.cpp"
)
add_includedirs(
"src"
)
add_packages(
"levilamina",
"parallel-hashmap"
)
add_packages(
"bdslibrary"
)
add_shflags(
"/DELAYLOAD:bedrock_server.dll" -- To use forged symbols of SymbolProvider.
)
set_exceptions("none") -- To avoid conflicts with /EHa.
set_kind("shared")
set_languages("cxx20")
set_symbols("debug")
after_build(function (target)
local plugin_packer = import("scripts.after_build")
local tag = os.iorun("git describe --tags --abbrev=0 --always")
local major, minor, patch, suffix = tag:match("v(%d+)%.(%d+)%.(%d+)(.*)")
if not major then
print("Failed to parse version tag, using 0.0.0")
major, minor, patch = 0, 0, 0
end
local plugin_define = {
pluginName = target:name(),
pluginFile = path.filename(target:targetfile()),
pluginVersion = major .. "." .. minor .. "." .. patch,
}
plugin_packer.pack_plugin(target,plugin_define)
end)