Merge pull request #79 from acrisci/system-lua-pkg-config
find system lua with pkg-config
This commit is contained in:
commit
c07abdc03e
|
@ -31,6 +31,7 @@ compiletest_rs = { version = "0.3", optional = true }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
cc = { version = "1.0", optional = true }
|
cc = { version = "1.0", optional = true }
|
||||||
|
pkg-config = "0.3.11"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
rustyline = "1.0.0"
|
rustyline = "1.0.0"
|
||||||
|
|
7
build.rs
7
build.rs
|
@ -1,6 +1,9 @@
|
||||||
#[cfg(feature = "builtin-lua")]
|
#[cfg(feature = "builtin-lua")]
|
||||||
extern crate cc;
|
extern crate cc;
|
||||||
|
|
||||||
|
#[cfg(not(feature = "builtin-lua"))]
|
||||||
|
extern crate pkg_config;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(feature = "builtin-lua")]
|
#[cfg(feature = "builtin-lua")]
|
||||||
{
|
{
|
||||||
|
@ -62,4 +65,8 @@ fn main() {
|
||||||
.file("lua/lzio.c")
|
.file("lua/lzio.c")
|
||||||
.compile("liblua5.3.a");
|
.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_GCSETSTEPMUL: c_int = 7;
|
||||||
pub const LUA_GCISRUNNING: c_int = 9;
|
pub const LUA_GCISRUNNING: c_int = 9;
|
||||||
|
|
||||||
#[link(name = "lua5.3")]
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn lua_newstate(alloc: lua_Alloc, ud: *mut c_void) -> *mut lua_State;
|
pub fn lua_newstate(alloc: lua_Alloc, ud: *mut c_void) -> *mut lua_State;
|
||||||
pub fn lua_close(state: *mut lua_State);
|
pub fn lua_close(state: *mut lua_State);
|
||||||
|
|
Loading…
Reference in New Issue