-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathlua-xmake.lua
66 lines (61 loc) · 1.45 KB
/
lua-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
add_rules("mode.debug", "mode.release")
local function handle_plat(target)
if is_plat("windows") then
target:add("defines", "LUA_USE_WINDOWS")
if target:kind() ~= "binary" then
target:add("defines", "LUA_BUILD_AS_DLL")
end
elseif is_plat("macosx") then
target:add("defines", "LUA_USE_MACOSX")
target:add("links", "m")
if target:kind() == "binary" then
target:add("defines", "LUA_USE_READLINE")
target:add("links", "readline")
end
elseif is_plat("linux") then
target:add("defines", "LUA_USE_LINUX")
target:add("links", "m", "dl")
if target:kind() == "binary" then
target:add("defines", "LUA_USE_READLINE")
target:add("links", "readline")
end
target:add("ldflags", "-Wl,-E")
end
if is_mode("debug") then
target:set("symbols", "debug")
else
target:set("symbols", "")
end
end
target("luast") do
set_kind("static")
set_basename("lua-static")
add_files("src/*.c|luac.c|lua.c")
set_warnings("allextra")
set_optimize("faster")
on_load(handle_plat)
end
target("luash") do
set_kind("shared")
set_basename("lua")
add_files("src/*.c|luac.c|lua.c")
set_warnings("allextra")
set_optimize("faster")
on_load(handle_plat)
end
target("lua") do
set_kind("binary")
add_deps("luast")
add_files("src/lua.c")
set_warnings("allextra")
set_optimize("faster")
on_load(handle_plat)
end
target("luac") do
set_kind("binary")
add_files("src/luac.c")
add_deps("luast")
set_warnings("allextra")
set_optimize("faster")
on_load(handle_plat)
end