feat(script): add voltex_script crate with Lua 5.4 FFI and safe wrapper
Compiles Lua 5.4 from source via cc crate (excluding lua.c/luac.c). Provides ffi bindings, LuaState safe wrapper, and default engine bindings. All 9 tests pass (exec, globals, register_fn, voltex_print). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
19
crates/voltex_script/build.rs
Normal file
19
crates/voltex_script/build.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
fn main() {
|
||||
let mut build = cc::Build::new();
|
||||
build.include("lua");
|
||||
|
||||
// Add all .c files except lua.c and luac.c (standalone executables with main())
|
||||
for entry in std::fs::read_dir("lua").unwrap() {
|
||||
let path = entry.unwrap().path();
|
||||
if let Some(ext) = path.extension() {
|
||||
if ext == "c" {
|
||||
let name = path.file_name().unwrap().to_str().unwrap();
|
||||
if name != "lua.c" && name != "luac.c" {
|
||||
build.file(&path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
build.compile("lua54");
|
||||
}
|
||||
Reference in New Issue
Block a user