-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathxmake.lua
More file actions
65 lines (57 loc) · 1.82 KB
/
xmake.lua
File metadata and controls
65 lines (57 loc) · 1.82 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
if not is_arch("arm64") then
includes("VC-LTL5.lua")
end
add_rules("mode.debug", "mode.release")
set_warnings("more")
add_defines("WIN32", "_WIN32")
add_defines("UNICODE", "_UNICODE", "_CRT_SECURE_NO_WARNINGS", "_CRT_NONSTDC_NO_DEPRECATE")
if is_mode("release") then
set_exceptions("none")
set_optimize("smallest")
set_runtimes("MT")
add_defines("NDEBUG")
add_cxflags("/Gy", "/fp:precise")
add_ldflags("/DYNAMICBASE", "/LTCG")
if not is_arch("arm64") then
add_requires("vc-ltl5")
end
end
add_cxflags("/utf-8")
add_links("gdiplus", "kernel32", "user32", "gdi32", "winspool", "comdlg32")
add_links("advapi32", "shell32", "ole32", "oleaut32", "uuid", "odbc32", "odbccp32")
target("detours")
set_kind("static")
add_includedirs("detours/src", {public=true})
add_files(
"detours/src/detours.cpp",
"detours/src/disasm.cpp",
"detours/src/image.cpp",
"detours/src/modules.cpp"
)
if is_arch("x86") then
add_defines("_X86_")
add_files("detours/src/disolx86.cpp")
elseif is_arch("x64") then
add_defines("_AMD64_")
add_files("detours/src/disolx64.cpp")
elseif is_arch("arm64") then
add_defines("_ARM64_")
add_files("detours/src/disolarm64.cpp")
end
target("vivaldi_plus")
set_kind("shared")
set_languages("c++20")
set_targetdir("$(builddir)/$(mode)/$(arch)")
set_basename("version")
add_deps("detours")
add_files("src/*.cpp")
add_files("src/*.rc")
add_links("user32", "crypt32", "propsys", "netapi32")
if is_mode("release") and not is_arch("arm64") then
add_packages("vc-ltl5")
end
after_build(function (target)
local builddir = "$(builddir)/$(mode)/$(arch)"
os.rm(builddir .. "/version.exp")
os.rm(builddir .. "/version.lib")
end)