-
Notifications
You must be signed in to change notification settings - Fork 0
/
mingen.lua
33 lines (29 loc) · 1011 Bytes
/
mingen.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
mg.configurations({"debug", "release"})
local mincore = mg.project({
name = "mincore",
type = mg.project_type.sources,
sources = {"src/**.cc"},
compile_options = {"-g", "-Wall", "-Wextra", "-nostdinc++", "--std=c++20"},
debug = {
compile_options = {"-O0", "-fprofile-instr-generate", "-fcoverage-mapping"}
},
release = {
compile_options = {"-O2", "-Werror"}
},
})
linker_type_arg = ""
if mg.platform() == "windows" then
linker_type_arg = "-fuse-ld=lld"
elseif mg.platform() == "linux" then
linker_type_arg = "-fuse-ld=ld"
end
local tests_exe = mg.project({
name = "tests",
type = mg.project_type.executable,
sources = {"tests/**.cc"},
includes = {"src"},
compile_options = {"-g", "-O0", "-Wall", "-Wextra", "-Werror", "-fno-char8_t", "-nostdinc++", "--std=c++20", "-D_CRT_SECURE_NO_WARNINGS", "-fprofile-instr-generate", "-fcoverage-mapping"},
link_options = {linker_type_arg, "-g", "-fprofile-instr-generate", "-fcoverage-mapping"},
dependencies = {mincore}
})
mg.generate({tests_exe})