-
-
Notifications
You must be signed in to change notification settings - Fork 423
Expand file tree
/
Copy pathmake.lua
More file actions
132 lines (113 loc) · 2.63 KB
/
make.lua
File metadata and controls
132 lines (113 loc) · 2.63 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
local lm = require 'luamake'
lm.c = lm.compiler == 'msvc' and 'c89' or 'c11'
lm.cxx = 'c++17'
lm.lua = "55"
if lm.sanitize then
lm.mode = "debug"
lm.flags = "-fsanitize=address"
lm.gcc = {
ldflags = "-fsanitize=address"
}
lm.clang = {
ldflags = "-fsanitize=address"
}
end
local includeCodeFormat = true
require "make.detect_platform"
-- Increase Lua's max nested C-call depth.
-- Default is 200; deeply nested method chains (e.g. 70-level FCall chains)
-- consume ~8 C frames per level via __index getters, requiring ~560 slots.
lm:conf {
defines = 'LUAI_MAXCCALLS=1000',
}
lm:import "3rd/bee.lua/make.lua"
lm:import "make/code_format.lua"
lm:source_set 'lpeglabel' {
rootdir = '3rd',
includes = "bee.lua/3rd/lua55",
sources = "lpeglabel/*.c",
defines = {
'MAXRECLEVEL=1000',
},
deps = "source_lua",
}
lm:executable "lua-language-server" {
deps = {
"source_bee",
"source_lua",
"lpeglabel",
"source_bootstrap",
includeCodeFormat and "code_format" or nil,
},
includes = {
"3rd/bee.lua",
"3rd/bee.lua/3rd/lua55",
},
sources = "make/modules.cpp",
windows = {
sources = {
"make/lua-language-server.rc",
}
},
defines = {
includeCodeFormat and 'CODE_FORMAT' or nil,
},
linux = {
crt = "static",
ldflags = { "-rdynamic" },
}
}
local platform = require 'bee.platform'
local exe = platform.os == 'windows' and ".exe" or ""
lm:copy "copy_lua-language-server" {
inputs = "$bin/lua-language-server" .. exe,
outputs = "bin/lua-language-server" .. exe,
}
lm:copy "copy_bootstrap" {
inputs = "make/bootstrap.lua",
outputs = "bin/main.lua",
}
lm:msvc_copydll 'copy_vcrt' {
type = "vcrt",
outputs = "bin",
}
lm:phony "all" {
deps = {
"lua-language-server",
"copy_lua-language-server",
"copy_bootstrap",
},
windows = {
deps = {
"copy_vcrt"
}
}
}
if lm.notest then
lm:default {
"all",
}
return
end
lm:rule "run-bee-test" {
args = { "$bin/lua-language-server" .. exe, "$in" },
description = "Run test: $in.",
pool = "console",
}
lm:rule "run-unit-test" {
args = { "bin/lua-language-server" .. exe, "--test" },
description = "Run test: $in.",
pool = "console",
}
lm:build "bee-test" {
rule = "run-bee-test",
deps = { "lua-language-server", "copy_script" },
inputs = "3rd/bee.lua/test/test.lua",
}
lm:build 'unit-test' {
rule = "run-unit-test",
deps = { "bee-test", "all" },
}
lm:default {
"unit-test",
}