-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmake.lua
executable file
·98 lines (97 loc) · 2.72 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
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
add_includedirs("include")
add_linkdirs("lib")
add_defines("UNICODE")
target("detours")
set_kind("static")
add_includedirs("deps/detour/src")
add_files("deps/detour/src/*.cpp|uimports.cpp")
add_defines("WIN32_LEAN_AND_MEAN")
add_defines("_WIN32_WINNT=0x501")
add_defines("DETOUR_DEBUG=0")
after_build(function(target)
os.cp(target:targetfile(), "$(projectdir)/lib")
end)
-- no longer needed
-- target("withdll")
-- set_kind("binary")
-- add_files("deps/detour/samples/withdll/withdll.cpp")
-- add_links("detours")
-- after_build(function(target)
-- os.cp(target:targetfile(), "bin")
-- end)
target("yhook")
add_deps("detours")
set_kind("shared")
add_files("src/yhook.cc")
add_links("detours")
add_links("wsock32")
add_links("ws2_32")
add_defines("ADD_EXPORTS")
after_build(function(target)
os.cp(target:targetfile(), "bin")
end)
target("yprocmon")
set_kind("binary")
add_files("src/yprocmon.cc")
add_files("src/yprocmon.rc")
add_links("detours")
add_links("wsock32")
add_links("ws2_32")
add_links("shlwapi")
add_defines("RAPIDJSON_HAS_STDSTRING")
after_build(function(target)
os.cp(target:targetfile(), "bin")
end)
target("ymockipc")
set_kind("binary")
add_files("src/ymockipc.cpp")
after_build(function(target)
os.mkdir("bin/test")
os.cp(target:targetfile(), "bin/test")
end)
-- samples start
target("ymsgbox")
set_kind("binary")
add_files("samples/ymsgbox.c")
after_build(function(target)
os.mkdir("bin/samples")
os.cp(target:targetfile(), "bin/samples//")
end)
target("yhttp")
set_kind("binary")
add_files("samples/yhttp.cpp")
add_links("wsock32")
add_links("ws2_32")
after_build(function(target)
os.cp(target:targetfile(), "bin/samples/")
end)
target("yheap")
set_kind("binary")
add_files("samples/yheap.c")
after_build(function(target)
os.cp(target:targetfile(), "bin/samples/")
end)
target("yfile")
set_kind("binary")
add_files("samples/yfile.c")
after_build(function(target)
os.cp(target:targetfile(), "bin/samples/")
end)
target("yreg")
set_kind("binary")
add_files("samples/yreg.c")
after_build(function(target)
os.cp(target:targetfile(), "bin/samples/")
end)
-- samples end
on_install(function()
if is_arch("x86_64", "x64") then
print("Installing MinGW x86_64 libraries...")
os.cp("/usr/x86_64-w64-mingw32/bin/*.dll", "bin")
else
print("Installing MinGW i686 libraries...")
os.cp("/usr/i686-w64-mingw32/bin/*.dll", "bin")
end
os.mkdir("bin/www")
os.cp("yprocmon-front/build/*", "bin/www")
end)