-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmake.lua
55 lines (45 loc) · 1.35 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
-- disable jit compiler for redhat and centos
local jit = true
local autogendir = "autogen/$(plat)/jit/$(arch)"
if os.isfile("/etc/redhat-release") then
jit = false
autogendir = "autogen/$(plat)/nojit/$(arch)"
end
-- ios not support jit
if is_plat("iphoneos") then
jit = false
end
-- add target
target("luajit")
-- make as a static library
set_kind("static")
-- set warning all and disable error
set_warnings("all")
-- disable c99(/TP) for windows
if is_plat("windows") then
set_languages("c89")
end
-- add header files
add_headerfiles("luajit/src/(*.h)", {prefixdir = "luajit"})
-- add include directories
add_includedirs(autogendir)
add_includedirs("luajit/src", {public = true})
-- add the common source files
add_files("luajit/src/*.c|ljamalg.c|luajit.c")
if is_plat("windows") then
add_files(autogendir .. "/lj_vm.obj")
elseif is_plat("msys", "cygwin") then
add_files(autogendir .. "/lj_vm.o")
else
add_files(autogendir .. "/*.S")
end
-- disable jit compiler?
if not jit then
add_defines("LUAJIT_DISABLE_JIT")
end
-- enable lua5.2 compat, @see http://luajit.org/extensions.html
--[[
add_defines("LUAJIT_ENABLE_LUA52COMPAT")
if not is_plat("windows") then
add_cflags("-Wno-error=unused-function")
end]]