forked from BasedInc/libhat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
64 lines (53 loc) · 1.63 KB
/
xmake.lua
File metadata and controls
64 lines (53 loc) · 1.63 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
set_project("libhat")
set_version("0.6.0")
set_languages("cxx20")
-- Options
option("disable_sse")
set_default(false)
set_showmenu(true)
option("disable_avx512")
set_default(false)
set_showmenu(true)
option("hint_x86_64")
set_default(true)
set_showmenu(true)
-- Define the library
target("libhat")
set_kind("static")
add_includedirs("include", {public = true})
add_files(
"src/Scanner.cpp",
"src/System.cpp",
"src/os/linux/MemoryProtector.cpp",
"src/os/linux/Process.cpp",
"src/os/unix/System.cpp",
"src/os/win32/MemoryProtector.cpp",
"src/os/win32/Process.cpp",
"src/os/win32/Scanner.cpp",
"src/os/win32/System.cpp",
"src/arch/x86/SSE.cpp",
"src/arch/x86/AVX2.cpp",
"src/arch/x86/AVX512.cpp",
"src/arch/x86/System.cpp",
"src/arch/arm/System.cpp"
)
-- Compile definitions
if has_config("disable_sse") then
add_defines("LIBHAT_DISABLE_SSE")
end
if has_config("disable_avx512") then
add_defines("LIBHAT_DISABLE_AVX512")
end
if has_config("hint_x86_64") then
add_defines("LIBHAT_HINT_X86_64")
end
-- Platform-specific compiler flags
if is_plat("windows") then
if is_arch("x86_64") then
add_cxxflags("/W3", "/WX")
end
elseif is_plat("linux") or is_plat("macosx") then
add_cxxflags("-Wall", "-Wextra", "-Wconversion", "-Werror", "-Wno-unused-command-line-argument")
-- Optional: add SIMD flags
add_cxxflags("-msse4.1", "-mavx", "-mavx2", "-mbmi", "-mavx512f", "-mavx512bw", "-mxsave")
end