forked from Tencent/ScriptX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmake.lua
86 lines (73 loc) · 2.05 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
add_rules("mode.debug", "mode.release")
add_repositories("liteldev-repo C:\\Users\\shrbo\\OtherProjects\\xmake-repo")
if is_config("backend", "Lua") then
add_requires("lua v5.4.7", {configs={shared=true}})
elseif is_config("backend", "QuickJs") then
add_requires("quickjs-ng v0.8.0", {configs={shared=true, libc=true}})
elseif is_config("backend", "Python") then
add_requires("python 3.12.8", {configs={shared=true}})
elseif is_config("backend", "V8") then
add_requires("node v22.12.0", {configs={shared=true}})
end
option("backend")
set_default("Lua")
set_values("Lua", "QuickJs", "Python", "V8")
target("ScriptX")
add_files(
"src/**.cc"
)
add_headerfiles(
"(**.h)",
"(**.hpp)"
)
add_includedirs(
"src/include/"
)
set_kind("static")
set_languages("cxx20")
if is_config("backend", "Lua") then
add_defines(
"SCRIPTX_BACKEND_LUA",
"SCRIPTX_BACKEND_TRAIT_PREFIX=../backend/Lua/trait/Trait"
)
add_files(
"backend/Lua/**.cc"
)
add_packages(
"lua"
)
elseif is_config("backend", "QuickJs") then
add_defines(
"SCRIPTX_BACKEND_QUICKJS",
"SCRIPTX_BACKEND_TRAIT_PREFIX=../backend/QuickJs/trait/Trait"
)
add_files(
"backend/QuickJs/**.cc"
)
add_packages(
"quickjs-ng"
)
elseif is_config("backend", "Python") then
add_defines(
"SCRIPTX_BACKEND_PYTHON",
"SCRIPTX_BACKEND_TRAIT_PREFIX=../backend/Python/trait/Trait"
)
add_files(
"backend/Python/**.cc",
"backend/Python/**.c"
)
add_packages(
"python"
)
elseif is_config("backend", "V8") then
add_defines(
"SCRIPTX_BACKEND_V8",
"SCRIPTX_BACKEND_TRAIT_PREFIX=../backend/V8/trait/Trait"
)
add_files(
"backend/V8/**.cc"
)
add_packages(
"node"
)
end