diff options
-rw-r--r-- | Cargo.toml | 3 | ||||
-rw-r--r-- | build.rs | 7 | ||||
-rw-r--r-- | src/ffi.rs | 1 |
3 files changed, 9 insertions, 2 deletions
@@ -31,6 +31,7 @@ compiletest_rs = { version = "0.3", optional = true } [build-dependencies] cc = { version = "1.0", optional = true } +pkg-config = "0.3.11" [dev-dependencies] rustyline = "1.0.0" @@ -38,4 +39,4 @@ criterion = "0.2.0" [[bench]] name = "benchmark" -harness = false
\ No newline at end of file +harness = false @@ -1,6 +1,9 @@ #[cfg(feature = "builtin-lua")] extern crate cc; +#[cfg(not(feature = "builtin-lua"))] +extern crate pkg_config; + fn main() { #[cfg(feature = "builtin-lua")] { @@ -62,4 +65,8 @@ fn main() { .file("lua/lzio.c") .compile("liblua5.3.a"); } + #[cfg(not(feature = "builtin-lua"))] + { + pkg_config::Config::new().atleast_version("5.3").probe("lua").unwrap(); + } } @@ -78,7 +78,6 @@ pub const LUA_GCSETPAUSE: c_int = 6; pub const LUA_GCSETSTEPMUL: c_int = 7; pub const LUA_GCISRUNNING: c_int = 9; -#[link(name = "lua5.3")] extern "C" { pub fn lua_newstate(alloc: lua_Alloc, ud: *mut c_void) -> *mut lua_State; pub fn lua_close(state: *mut lua_State); |