-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
44 lines (40 loc) · 1.45 KB
/
xmake.lua
File metadata and controls
44 lines (40 loc) · 1.45 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
add_requires("gtest", "luajit", "swig")
add_defines("_GLIBCXX_USE_CXX11_ABI=0")
add_includedirs("./deps/hlsdk/engine")
add_includedirs("./deps/hlsdk/common")
add_includedirs("./deps/hlsdk/pm_shared")
add_includedirs("./deps/hlsdk/dlls")
add_includedirs("./deps/hlsdk/public")
add_includedirs("./deps/metamod/metamod")
add_includedirs("./source")
local lua_wrapper = "$(buildir)/lua_wrapper.cc"
target("luambda")
add_packages("luajit", "swig")
set_kind("shared")
set_symbols("debug")
set_prefixname("")
add_files("./source/**.cc")
add_files(lua_wrapper)
-- add_shflags("-nodefaultlibs -fno-rtti -fno-exceptions -lc -lm -ldl")
before_build(function(target)
os.exec(
"swig -c++ -lua %s -o %s -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS %s",
table.concat(
{
"-I$(projectdir)/deps/hlsdk/engine",
"-I$(projectdir)/deps/hlsdk/common",
"-I$(projectdir)/deps/hlsdk/pm_shared",
"-I$(projectdir)/deps/hlsdk/dlls",
"-I$(projectdir)/deps/hlsdk/public",
"-I$(projectdir)/deps/metamod/metamod",
"-I$(projectdir)/source"
},
" "
),
lua_wrapper,
"$(projectdir)/source/bindings/lua.swig"
)
end)
after_build(function(target)
os.cp(target:targetfile(), "$(projectdir)/bin/")
end)