-
Notifications
You must be signed in to change notification settings - Fork 115
/
build.rs
51 lines (44 loc) · 1.3 KB
/
build.rs
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
fn main() {
let mut lua_version_features = 0;
#[cfg(feature = "builtin-lua54")]
{
println!("cargo:rustc-cfg=rlua_lua54");
lua_version_features += 1;
}
#[cfg(feature = "builtin-lua53")]
{
println!("cargo:rustc-cfg=rlua_lua53");
lua_version_features += 1;
}
#[cfg(feature = "builtin-lua51")]
{
println!("cargo:rustc-cfg=rlua_lua51");
lua_version_features += 1;
}
#[cfg(feature = "system-lua54")]
{
println!("cargo:rustc-cfg=rlua_lua54");
lua_version_features += 1;
}
#[cfg(feature = "system-lua53")]
{
println!("cargo:rustc-cfg=rlua_lua53");
lua_version_features += 1;
}
#[cfg(feature = "system-lua51")]
{
println!("cargo:rustc-cfg=rlua_lua51");
lua_version_features += 1;
}
#[cfg(feature = "system-luajit")]
{
println!("cargo:rustc-cfg=rlua_lua51");
println!("cargo:rustc-cfg=rlua_luajit");
lua_version_features += 1;
}
if lua_version_features < 1 {
panic!("No Lua version specified. Please enable one of the features. use --no-default-features to disable default lua feature.");
} else if lua_version_features > 1 {
panic!("Cannot enable more than one Lua interpreter feature.");
}
}