aboutsummaryrefslogtreecommitdiff
path: root/src/pow_lua.c
diff options
context:
space:
mode:
authorforever2k38 <forever2k38@forever2k38.net>2026-10-13 22:10:24 +0200
committerforever2k38 <forever2k38@forever2k38.net>2026-10-13 22:10:24 +0200
commit8781a6d4f9d5840c7c9954706c972564bd40e76e (patch)
tree74e49fc74bb14fd8a390a2323b06f7fdd8ac40d1 /src/pow_lua.c
parent63f6adddc8b2098daf223be85e79f74c07db3ad4 (diff)
feat: copy build config instead of just makeopts
Diffstat (limited to 'src/pow_lua.c')
-rw-r--r--src/pow_lua.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/pow_lua.c b/src/pow_lua.c
index 642077f..b3fa69b 100644
--- a/src/pow_lua.c
+++ b/src/pow_lua.c
@@ -305,8 +305,18 @@ int pow_lua_load(lua_State *L, pow_config *cfg) {
lua_createtable(L, 0, 1);
- lua_pushstring(L, cfg->makeopts);
- lua_setfield(L, -2, "makeopts");
+ lua_setfield(L, -2, "config");
+
+ lua_rawgeti(cfg->L_cfg, LUA_REGISTRYINDEX, cfg->build_cfg_ref);
+
+ if (!lua_istable(cfg->L_cfg, -1)) {
+ pow_log_error("failed to initialize lua: config.build is not a table");
+ lua_pop(cfg->L_cfg, 1);
+
+ return 1;
+ }
+
+ lua_xmove(cfg->L_cfg, L, 1);
lua_setfield(L, -2, "config");
@@ -314,3 +324,4 @@ int pow_lua_load(lua_State *L, pow_config *cfg) {
return 0;
}
+