summaryrefslogtreecommitdiff
path: root/core/src/luajit/xmake.lua
blob: ad6ba5261b389b168b0e5fc86dc7321755199948 (plain)
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
-- disable jit compiler for redhat and centos
local jit = true
local autogendir = "src/autogen/$(plat)/jit/$(arch)"
if os.isfile("/etc/redhat-release") then
    jit = false
    autogendir = "src/autogen/$(plat)/nojit/$(arch)"
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")
    else
	set_languages("gnu99")
    end

    -- set the object files directory
    set_objectdir("$(buildir)/.objs")

    -- add headers
    add_headers("src/(*.h)")
    set_headerdir("$(buildir)/luajit")

    -- add include directories
    add_includedirs("src", autogendir)

    -- add the common source files
    add_files("src/*.c|ljamalg.c|luajit.c") 
    if is_plat("windows") then
        add_files(autogendir .. "/lj_vm.obj")
    else
        add_files(autogendir .. "/*.S")
    end

    -- disable jit compiler?
    if not jit then
        add_defines("LUAJIT_DISABLE_JIT")
    end