-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpremake5.lua
More file actions
32 lines (27 loc) · 1.29 KB
/
premake5.lua
File metadata and controls
32 lines (27 loc) · 1.29 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
---@diagnostic disable: undefined-global
local LOCAL_DIR = _SCRIPT_DIR
if os.host() == "windows" then
LOCAL_DIR = path.translate(LOCAL_DIR)
end
project "lrust"
kind "Makefile"
filter "configurations:release"
buildcommands {
-- cargo build --no-default-features --features="http,websocket"
string.format("{CHDIR} %s && cargo build --release", LOCAL_DIR),
string.format("{COPYFILE} %s/target/release/%s %s ", LOCAL_DIR, get_sharedlib_name("librust"), MOON_DIR.."/clib/"..get_sharedlib_name("rust")),
string.format("{COPY} %s/lualib/* %s ", LOCAL_DIR, MOON_DIR.."/lualib/ext/"),
}
cleancommands {
string.format("{CHDIR} %s && cargo clean --release", LOCAL_DIR),
}
filter "configurations:debug"
buildcommands {
-- cargo build --no-default-features --features="http,websocket"
string.format("{CHDIR} %s && cargo build", LOCAL_DIR),
string.format("{COPYFILE} %s/target/debug/%s %s ", LOCAL_DIR, get_sharedlib_name("librust"), MOON_DIR.."/clib/"..get_sharedlib_name("rust")),
string.format("{COPY} %s/lualib/* %s ", LOCAL_DIR, MOON_DIR.."/lualib/ext/"),
}
cleancommands {
string.format("{CHDIR} %s && cargo clean", LOCAL_DIR),
}