Repository navigation
Expand file tree
/
Copy pathxmake.lua
More file actions
55 lines (48 loc) · 1.96 KB
/
Copy pathxmake.lua
File metadata and controls
55 lines (48 loc) · 1.96 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
add_rules("mode.release", "mode.debug")
add_rules("plugin.compile_commands.autoupdate", {outputdir=".vscode"})
add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
add_repositories("oeo-repo https://github.com/OEOTYAN/xmake-repo.git")
option("target_type")
set_default("server")
set_showmenu(true)
set_values("server", "client")
option_end()
add_requires("levilamina 2d60b68f40acb5a415e385bc1d2e104302a0bfee", {configs = {target_type = get_config("target_type")}})
add_requires("levibuildscript")
add_requires("bsci", {configs = {target_type = get_config("target_type")}})
add_requires("tinyobjloader")
add_requires("exprtk")
-- add_requires("openimageio")
if not has_config("vs_runtime") then
set_runtimes("MD")
end
target("WorldEdit") -- Change this to your mod name.
add_rules("@levibuildscript/linkrule")
add_rules("@levibuildscript/modpacker")
set_exceptions("none") -- To avoid conflicts with /EHa.
add_cxflags( "/EHa", "/utf-8", "/W4", "/w44265", "/w44289", "/w44296", "/w45263", "/w44738", "/w45204")
add_defines("_HAS_CXX23=1", "NOMINMAX", "UNICODE")
add_files("src/**.cpp")
add_includedirs("src")
add_files("thirdparty/**.cpp")
add_includedirs("thirdparty")
set_pcxxheader("src/worldedit/Global.h")
add_packages("levilamina", "bsci", "tinyobjloader", "exprtk") --, "openimageio")
set_kind("shared")
set_languages("c++20")
set_symbols("debug")
if is_config("target_type", "server") then
-- add_includedirs("src-server")
-- add_files("src-server/**.cpp")
else
-- add_includedirs("src-client")
-- add_files("src-client/**.cpp")
end
after_buildcmd(function(target, batchcmds)
local outputdir = path.join(os.projectdir(), "bin", target:name())
local assetsdir = path.join(os.projectdir(), "assets")
if os.isdir(assetsdir) then
batchcmds:mkdir(outputdir)
batchcmds:cp(path.join(assetsdir, "*"), outputdir)
end
end)