summaryrefslogtreecommitdiff
path: root/core/src/lua/xmake.lua
blob: 379bdc46a6f3633f566ccb20bf97c44fddd886f8 (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
target("lua")
    if not is_config("runtime", "lua") then
        set_default(false)
    end
    set_kind("static")
    set_warnings("all")

    -- disable c99(/TP) for windows
    if is_plat("windows") then
        set_languages("c89")
    end

    -- add header files
    add_headerfiles("lua/(*.h)", {prefixdir = "lua"})

    -- add include directories
    add_includedirs("lua", {public = true})

    -- add the common source files
    add_files("lua/*.c|lua.c|onelua.c")

    -- add defines
    add_defines("LUA_COMPAT_5_1", "LUA_COMPAT_5_2", "LUA_COMPAT_5_3", {public = true})
    if is_plat("windows") then
        add_defines("LUA_USE_WINDOWS")
    elseif is_plat("macosx", "iphoneos") then
        add_defines("LUA_USE_MACOSX")
    else
        add_defines("LUA_USE_LINUX")
    end