Merge pull request #79 from acrisci/system-lua-pkg-config

find system lua with pkg-config
This commit is contained in:
kyren 2018-09-16 20:57:45 -04:00 committed by GitHub
commit c07abdc03e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -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"

View File

@ -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();
}
}

View File

@ -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);