Repository navigation
Expand file tree
/
Copy pathxmake.lua
More file actions
76 lines (68 loc) · 2.56 KB
/
Copy pathxmake.lua
File metadata and controls
76 lines (68 loc) · 2.56 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
add_rules("mode.debug", "mode.release")
add_repositories("levimc-repo https://github.com/LiteLDev/xmake-repo.git")
-- LaminaSort is a client-only mod. The option is kept because LeviBuildScript's
-- link/pack rules read it, but "client" is the only accepted value.
option("target_type")
set_default("client")
set_showmenu(true)
set_values("client")
option_end()
-- Diagnostic build: raises the mod's logger to Debug and mirrors it, flushed
-- immediately, into mods/LaminaSort/trace.log. Off by default.
option("trace")
set_default(false)
set_showmenu(true)
set_description("Enable verbose runtime diagnostics")
option_end()
-- The "v" form checks out the upstream git tag directly; the LeviMC xmake-repo
-- had not published a 26.51.3 version entry when this was written. Switch to
-- "levilamina 26.51.3" once it has one.
add_requires("levilamina v26.51.3", {configs = {target_type = get_config("target_type")}})
add_requires("levibuildscript")
if not has_config("vs_runtime") then
set_runtimes("MD")
end
target("LaminaSort")
add_rules("@levibuildscript/linkrule")
add_rules("@levibuildscript/modpacker")
if is_plat("windows") then
add_defines("NOMINMAX", "UNICODE")
set_exceptions("none") -- To avoid conflicts with /EHa.
add_cxflags( "/EHa", "/utf-8", "/W4", "/w44265", "/w44289", "/w44296", "/w45263", "/w44738", "/w45204")
add_cxflags(
"/EHs",
"-Wno-microsoft-cast",
"-Wno-invalid-offsetof",
"-Wno-c++2b-extensions",
"-Wno-microsoft-include",
"-Wno-overloaded-virtual",
"-Wno-ignored-qualifiers",
"-Wno-missing-field-initializers",
"-Wno-potentially-evaluated-expression",
"-Wno-pragma-system-header-outside-header",
{tools = {"clang_cl"}}
)
set_toolchains("clang-cl")
end
add_packages("levilamina")
if has_config("trace") then
add_defines("LAMINASORT_TRACE")
end
set_kind("shared")
set_languages("c++20")
set_symbols("debug")
add_headerfiles("src/**.h")
add_files("src/**.cpp")
add_includedirs("src")
-- Unit tests for the pure (game-independent) sort planner. Not built by
-- default: `xmake build LaminaSortTests && xmake run LaminaSortTests`.
target("LaminaSortTests")
set_kind("binary")
set_default(false)
set_languages("c++20")
add_includedirs("src")
add_files("src/mod/sort/**.cpp", "tests/**.cpp")
if is_plat("windows") then
add_cxflags("/utf-8", "/W4")
set_toolchains("clang-cl")
end