summaryrefslogtreecommitdiff
path: root/make.lua
blob: a9262943289ee30355c2f3c92545507447bd58cb (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
local lm = require 'luamake'

lm:import '3rd/bee.lua/make.lua'

lm.arch = 'x64'
lm.rootdir = '3rd/'

local lua = 'lua54'
local includes = nil
local lpeglabel_ldflags = '/EXPORT:luaopen_lpeglabel'
if lm.plat == 'macos' then
    lua = 'lua'
    includes = {'bee.lua/3rd/lua/src'}
    lpeglabel_ldflags = nil
end

lm:shared_library 'lni' {
    deps = lua,
    sources = {
        'lni/src/main.cpp',
    },
    includes = includes
}

lm:shared_library 'lpeglabel' {
    deps = lua,
    sources = 'lpeglabel/*.c',
    ldflags = lpeglabel_ldflags,
    includes = includes
}

local rcedit = nil
if lm.plat ~= 'macos' then
    rcedit = 'rcedit'

    lm:executable 'rcedit' {
        sources = 'rcedit/src/*.cc',
        defines = {
            '_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING'
        },
        flags = {
            '/wd4477',
            '/wd4244',
            '/wd4267',
        }
    }
end

lm:build 'install' {
    '$luamake', 'lua', 'make/install.lua',
    deps = {
        'lua',
        'lni',
        'lpeglabel',
        'bee',
        rcedit
    }
}

lm:default {
    'install'
}