Allow luajit to build in the pointer size cross compilation case

This commit is contained in:
Wez Furlong 2021-01-13 20:01:12 -08:00
parent 24d9099ef7
commit faf19e4a06
1 changed files with 6 additions and 1 deletions

View File

@ -141,7 +141,6 @@ fn generate_glue() -> std::io::Result<()> {
write!(glue, "pub type LUA_UNSIGNED = u64;\n")?; write!(glue, "pub type LUA_UNSIGNED = u64;\n")?;
let version = if cfg!(feature = "luajit") || cfg!(feature = "lua51") { let version = if cfg!(feature = "luajit") || cfg!(feature = "lua51") {
// Note: luajit is ~lua 5.1, but it doesn't itself cross compile
(5, 1, 0) (5, 1, 0)
} else if cfg!(feature = "lua52") { } else if cfg!(feature = "lua52") {
(5, 2, 0) (5, 2, 0)
@ -192,7 +191,11 @@ fn generate_glue() -> std::io::Result<()> {
write!( write!(
glue, glue,
r#" r#"
#[cfg(feature = "luajit")]
pub const LUA_BITLIBNAME: &str = "bit";
#[cfg(not(feature = "luajit"))]
pub const LUA_BITLIBNAME: &str = "bit32"; pub const LUA_BITLIBNAME: &str = "bit32";
pub const LUA_COLIBNAME: &str = "coroutine"; pub const LUA_COLIBNAME: &str = "coroutine";
pub const LUA_DBLIBNAME: &str = "debug"; pub const LUA_DBLIBNAME: &str = "debug";
pub const LUA_IOLIBNAME: &str = "io"; pub const LUA_IOLIBNAME: &str = "io";
@ -203,6 +206,8 @@ pub const LUA_STRLIBNAME: &str = "string";
pub const LUA_TABLIBNAME: &str = "table"; pub const LUA_TABLIBNAME: &str = "table";
pub const LUA_UTF8LIBNAME: &str = "utf8"; pub const LUA_UTF8LIBNAME: &str = "utf8";
pub const LUA_JITLIBNAME: &str = "jit";
pub const LUA_FFILIBNAME: &str = "ffi";
"# "#
)?; )?;