-
Notifications
You must be signed in to change notification settings - Fork 388
Expand file tree
/
Copy pathxmake.lua
More file actions
69 lines (59 loc) · 1.89 KB
/
xmake.lua
File metadata and controls
69 lines (59 loc) · 1.89 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
add_rules("mode.debug", "mode.releasedbg")
add_rules("plugin.compile_commands.autoupdate", {outputdir = "build"})
set_languages("c++23")
includes("deps/yalantinglibs.lua")
includes("deps/breeze-js.lua")
add_requires("breeze-js-runtime")
add_requires("capstone", "fmt", "libffi", "asmjit", "gtest")
add_requires("xz", "reflect-cpp")
-- Platform defines
if is_os("windows") then
add_defines("CHROMATIC_WINDOWS")
elseif is_os("linux") then
add_defines("CHROMATIC_LINUX")
elseif is_os("macosx") then
add_defines("CHROMATIC_DARWIN")
elseif is_os("android") then
add_defines("CHROMATIC_ANDROID")
end
if is_os("linux") or is_os("android") then
add_cxflags("-fPIC")
add_ldflags("-fPIC")
end
-- Architecture defines
if is_arch("arm64", "aarch64", "arm64-v8a") then
add_defines("CHROMATIC_ARM64")
elseif is_arch("x86_64", "x64") then
add_defines("CHROMATIC_X64")
end
target("chromatic-core")
set_kind("static")
add_files("src/core/**.cc")
add_rules("utils.bin2obj", {extensions = ".js"})
add_files("src/core/typescript/dist/index.js")
add_packages("breeze-js-runtime", "fmt", "capstone", "libffi", "asmjit", {
public = true
})
add_headerfiles("src/core/**.h", "src/core/**.hpp")
add_includedirs("src", {
public = true
})
-- Platform link libraries
if is_os("windows") then
add_syslinks("kernel32", "psapi", "user32", "dbghelp")
elseif is_os("linux") then
add_syslinks("dl", "pthread")
elseif is_os("macosx") then
add_syslinks("dl", "pthread")
add_frameworks("CoreFoundation", "CoreServices")
end
target("chromatic-test")
set_kind("binary")
add_files("src/test/**.cc")
add_deps("chromatic-core")
add_packages("gtest")
target("chromatic-injectee")
set_kind("shared")
add_files("src/injectee/**.cc")
add_deps("chromatic-core")
add_packages("xz", "reflect-cpp", "fmt")