-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
56 lines (51 loc) · 2.11 KB
/
xmake.lua
File metadata and controls
56 lines (51 loc) · 2.11 KB
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
add_rules("mode.debug", "mode.release")
add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
add_requires("levilamina 1.2.0-rc.2", {configs = {target_type = "server"}})
add_requires("sqlitecpp")
add_requires("levibuildscript")
if not has_config("vs_runtime") then
set_runtimes("MD")
end
target("BakaEssentials")
add_rules("@levibuildscript/linkrule")
add_rules("@levibuildscript/modpacker")
add_cxflags( "/EHa", "/utf-8", "/W4", "/w44265", "/w44289", "/w44296", "/w45263", "/w44738", "/w45204")
set_pcxxheader("src/BakaET/StdAfx.hpp")
add_defines("NOMINMAX", "UNICODE")
add_packages("levilamina")
add_packages("sqlitecpp")
add_files("src/BakaET/BakaEssentials.rc")
add_configfiles("src/BakaET/Utils/Version.h.in")
set_configdir("$(buildir)/BakaET/Utils")
add_includedirs("$(buildir)")
set_exceptions("none")
set_kind("shared")
set_languages("c++23")
set_symbols("debug")
add_headerfiles("src/BakaET/**.h")
add_files("src/BakaET/**.cpp")
add_includedirs("src")
on_load(function (target)
import("core.base.json")
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 version from tooth.json")
tag = json.loadfile("tooth.json")["version"]
major, minor, patch, suffix = tag:match("(%d+)%.(%d+)%.(%d+)(.*)")
end
local versionStr = major.."."..minor.."."..patch
if suffix then
prerelease = suffix:match("-(.*)")
if prerelease then
prerelease = prerelease:gsub("\n", "")
end
if prerelease then
target:set("configvar", "PROJECT_VERSION_PRERELEASE", prerelease)
versionStr = versionStr.."-"..prerelease
end
end
target:set("configvar", "PROJECT_VERSION_MAJOR", major)
target:set("configvar", "PROJECT_VERSION_MINOR", minor)
target:set("configvar", "PROJECT_VERSION_PATCH", patch)
end)