-
Notifications
You must be signed in to change notification settings - Fork 4
/
xmake.lua
52 lines (49 loc) · 1.65 KB
/
xmake.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
set_project("app")
set_version("1.0.0")
set_warnings("all")
add_rules("mode.debug", "mode.release")
add_includedirs("include")
add_defines("_CRT_SECURE_NO_WARNINGS")
includes("@builtin/xpack")
includes("vendor/LCUI/xmake.lua")
target("app")
if is_plat("windows") then
add_rules("win.sdk.application")
add_files("version.rc")
end
set_configdir("include")
set_rundir("dist")
add_deps("lcui")
set_kind("binary")
add_files("app/**.c")
on_run(function (target)
import("core.base.option")
local argv = {}
local options = {{nil, "memcheck", "k", nil, "enable memory check."}}
local args = option.raw_parse(option.get("arguments") or {}, options)
os.cd("$(scriptdir)/dist")
if args.memcheck then
if is_plat("windows") then
table.insert(argv, target:targetfile())
os.execv("drmemory", argv)
else
table.insert(argv, "valgrind")
table.insert(argv, "--leak-check=full")
table.insert(argv, "--error-exitcode=42")
table.insert(argv, target:targetfile())
os.execv("sudo", argv)
end
else
os.execv(target:targetfile())
end
end)
xpack("app")
set_title("LCUI Quick Start ($(arch))")
set_description("A minimal LCUI application")
set_author("i@lc-soft.io")
set_maintainer("i@lc-soft.io")
set_copyright("Copyright (C) 2014-present, Liu Chao <i@lc-soft.io>")
set_licensefile("./LICENSE.md")
set_formats("nsis", "zip")
set_basename("lcui-quick-start-v$(version)")
add_installfiles("dist/(**)")