diff options
| author | frosty <gabriel@bwaaa.monster> | 2026-04-22 22:30:21 -0400 |
|---|---|---|
| committer | dacctal <dacctalyt@gmail.com> | 2026-04-24 03:39:52 +0000 |
| commit | f1d7a1903e49c75f9965693247e8d102a96b482c (patch) | |
| tree | 1edd5ebe0a62c00353f824581a24e0afa305873f /src/lua_build.cc | |
| parent | 0b9cc83f71399a41cf4e93ef82af7c8ba5c2ab96 (diff) | |
misc optimisations and QoL improvements
Diffstat (limited to 'src/lua_build.cc')
| -rw-r--r-- | src/lua_build.cc | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/lua_build.cc b/src/lua_build.cc index bf21f66..75a626a 100644 --- a/src/lua_build.cc +++ b/src/lua_build.cc @@ -1,24 +1,15 @@ #include <iostream> #include <filesystem> -#include <map> -extern "C" { -#include <luajit-2.1/lua.h> -#include <luajit-2.1/lauxlib.h> -#include <luajit-2.1/lualib.h> -} - +#include <unordered_map> +#include "lua_state.hh" #include "lua_build.hh" #include "vars.hh" -std::map<std::string, int> build_files; +std::unordered_map<std::string, int> build_files; bool lua_build(const char *path) { - lua_State *L = lua_open(); - luaL_openlibs(L); - - if (luaL_loadfile(L, config_file.c_str()) || lua_pcall(L, 0, 0, 0)){ - std::cout << print_error << "cannot run configuration script: " << lua_tostring(L, -1) << "\n"; - } + init_lua_state(); + lua_State *L = get_lua_state(); lua_getglobal(L, "build_systems"); @@ -57,4 +48,4 @@ bool lua_build(const char *path) { lua_pop(L, 1); } return build_found; -} +}
\ No newline at end of file |
