enable more lua platform defines in build.rs
This commit is contained in:
parent
75b7024a93
commit
7b00ff02f2
20
build.rs
20
build.rs
|
@ -5,13 +5,25 @@ use std::env;
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut config = gcc::Config::new();
|
let mut config = gcc::Config::new();
|
||||||
|
|
||||||
if env::var("CARGO_CFG_TARGET_OS") == Ok("linux".to_string()) {
|
let target_os = env::var("CARGO_CFG_TARGET_OS");
|
||||||
// Among other things, this enables `io.popen` support.
|
let target_family = env::var("CARGO_CFG_TARGET_FAMILY");
|
||||||
// Despite the name, we could enable this on more platforms.
|
|
||||||
|
if target_os == Ok("linux".to_string()) {
|
||||||
config.define("LUA_USE_LINUX", None);
|
config.define("LUA_USE_LINUX", None);
|
||||||
|
} else if target_os == Ok("macos".to_string()) {
|
||||||
|
config.define("LUA_USE_MACOSX", None);
|
||||||
|
} else if target_family == Ok("unix".to_string()) {
|
||||||
|
config.define("LUA_USE_POSIX", None);
|
||||||
|
} else if target_family == Ok("windows".to_string()) {
|
||||||
|
config.define("LUA_USE_WINDOWS", None);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.define("LUA_USE_APICHECK", None)
|
// Enables lua api checking, which has a slight performance penalty. We
|
||||||
|
// could allow disabling this via cfg one day when there is much more
|
||||||
|
// confidence in the soundness of the API.
|
||||||
|
config.define("LUA_USE_APICHECK", None);
|
||||||
|
|
||||||
|
config
|
||||||
.include("lua")
|
.include("lua")
|
||||||
.file("lua/lapi.c")
|
.file("lua/lapi.c")
|
||||||
.file("lua/lauxlib.c")
|
.file("lua/lauxlib.c")
|
||||||
|
|
Loading…
Reference in New Issue