-
Notifications
You must be signed in to change notification settings - Fork 69
/
xmake.lua
73 lines (59 loc) · 2.01 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
includes("info.lua")
local info = build_info(info_lua)
add_rules("mode.debug", "mode.release")
option("include_logging")
set_showmenu(true)
set_description("Include verbose logging on run")
add_defines("VERBOSE")
target("doorstop")
set_kind("shared")
set_optimize("smallest")
add_options("include_logging")
local load_events = {}
if is_os("windows") then
includes("src/windows/build_tools/proxygen.lua")
add_proxydef(load_events)
includes("src/windows/build_tools/rcgen.lua")
add_rc(load_events, info)
add_files("src/windows/*.c")
add_defines("UNICODE")
add_links("shell32", "kernel32", "user32")
end
if is_os("linux") or is_os("macosx") then
add_files("src/nix/*.c")
add_files("src/nix/plthook/*.c")
add_links("dl")
--add_shflags("--no-as-needed",{force=true})
if is_mode("debug") then
set_symbols("debug")
set_optimize("none")
end
end
if is_plat("windows") then
add_cxflags("-GS-", "-Ob2", "-MT", "-GL-", "-FS")
add_shflags("-nodefaultlib",
"-entry:DllEntry",
"-dynamicbase:no",
{force=true})
end
if is_plat("mingw") then
add_shflags("-nostdlib", "-nolibc", {force=true})
if is_arch("i386") then
add_shflags("-e _DllEntry", "-Wl,--enable-stdcall-fixup", {force=true})
elseif is_arch("x86_64") then
add_shflags("-e DllEntry", {force=true})
end
end
add_files("src/*.c")
add_files("src/config/*.c")
add_files("src/util/*.c")
add_files("src/runtimes/*.c")
on_load(function(target)
for i, event in ipairs(load_events) do
event(target, import, io)
end
end)
after_build(function(target)
io.writefile(path.join(target:targetdir(), ".doorstop_version"),
info.version.major.."."..info.version.minor.."."..info.version.patch..info.version.release)
end)