Skip to content

Commit faf19e4

Browse files
committed
Allow luajit to build in the pointer size cross compilation case
1 parent 24d9099 commit faf19e4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

build/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ fn generate_glue() -> std::io::Result<()> {
141141
write!(glue, "pub type LUA_UNSIGNED = u64;\n")?;
142142

143143
let version = if cfg!(feature = "luajit") || cfg!(feature = "lua51") {
144-
// Note: luajit is ~lua 5.1, but it doesn't itself cross compile
145144
(5, 1, 0)
146145
} else if cfg!(feature = "lua52") {
147146
(5, 2, 0)
@@ -192,7 +191,11 @@ fn generate_glue() -> std::io::Result<()> {
192191
write!(
193192
glue,
194193
r#"
194+
#[cfg(feature = "luajit")]
195+
pub const LUA_BITLIBNAME: &str = "bit";
196+
#[cfg(not(feature = "luajit"))]
195197
pub const LUA_BITLIBNAME: &str = "bit32";
198+
196199
pub const LUA_COLIBNAME: &str = "coroutine";
197200
pub const LUA_DBLIBNAME: &str = "debug";
198201
pub const LUA_IOLIBNAME: &str = "io";
@@ -203,6 +206,8 @@ pub const LUA_STRLIBNAME: &str = "string";
203206
pub const LUA_TABLIBNAME: &str = "table";
204207
pub const LUA_UTF8LIBNAME: &str = "utf8";
205208
209+
pub const LUA_JITLIBNAME: &str = "jit";
210+
pub const LUA_FFILIBNAME: &str = "ffi";
206211
"#
207212
)?;
208213

0 commit comments

Comments
 (0)