forked from desmonHak/VM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
99 lines (80 loc) · 2.71 KB
/
Copy pathxmake.lua
File metadata and controls
99 lines (80 loc) · 2.71 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
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
set_project ( "Testing" )
set_version ( "1.0.0" )
set_xmakever( "2.8.0" )
-- Generate compile_commands.json ----------------------------------------------------
rule( "vscode.compile_commands" )
after_config( function( target )
import( "core.base.task" ).run( "project", {
kind = "compile_commands",
outputdir = ".vscode"
})
end )
rule_end()
add_requires( "ftxui v6.1.9" )
add_requires( "sqlite3 3.51.0" )
add_requires( "capstone 5.0.6 ", { configs = {
arm = true , aarch64 = true , x86 = true,
mips = false, ppc = false, sparc = false,
sysz = false, xcore = false
}})
add_requires( "keystone master ", { configs = {
arm = true, arm64 = true, x86 = true,
build = true,
system = false,
shared = false,
cxflags = "-w",
cxxflags = {
"-std=c++11",
"-Wno-pedantic",
"-Wno-unused-parameter",
"-Wno-old-style-cast",
"-include",
"cstdint"
}
}})
add_rules( "vscode.compile_commands" )
-- MAIN TARGET -----------------------------------------------------------------------
target( "main" )
set_default ( true )
set_languages ( "c++17" )
set_kind ( "binary" )
set_filename ( "exec" )
set_symbols ( "none" )
set_optimize( "none" )
set_warnings( "none" )
add_files( "main.cpp", "src/**/*.cpp")
add_files( "libs/SourceCode/DistanciaLevenshtein/Levenshtein.cpp" )
add_includedirs( "include" )
add_includedirs( "libs/SourceCode/json" )
add_includedirs( "libs/SourceCode/cxxopts" )
add_includedirs( "libs/SourceCode/DistanciaLevenshtein" )
add_packages(
"ftxui" ,
"sqlite3" ,
"capstone" ,
"openssl"
)
add_packages( "keystone", { public = false })
add_defines( "__STDC_LIMIT_MACROS", "__STDC_CONSTANT_MACROS" )
if is_plat("windows") then
add_syslinks("ws2_32")
end
on_config( function( target )
import( "core.project.config" )
local triple = import( "xmake.triple" )
local flags = import( "xmake.config_flags" )
local info = triple.get( target )
if info.toolchain ~= "gcc" and info.toolchain ~= "clang" then
cprint( "${red}This project only supports GCC and Clang toolchains, but " .. toolchain .. " is being used." )
os.exit( 1 )
end
flags.apply( target, info )
if config.get("mode") == "debug" then
target:add("defines", "MODE_DEBUG_ENABLE")
end
triple.print_info( target, info )
end )
before_run( function( target )
cprint( "${green}[Running: " .. target:targetfile() .. "]" )
end )
target_end()