From bcb9f8a6d7d68a6e52d69ff4be0e2c2df2fe3aaf Mon Sep 17 00:00:00 2001 From: leso-kn Date: Fri, 27 Oct 2023 19:16:15 +0200 Subject: [PATCH] Fix C module loading on windows --- main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 8f056ea..dbb5abe 100644 --- a/main.js +++ b/main.js @@ -173,13 +173,13 @@ async function install_plain_lua_windows(luaExtractPath, luaInstallPath, luaVers } }) - objs["lua"] = [ ...objs["lua"], ...objs["lib"] ] - objs["luac"] = [ ...objs["luac"], ...objs["lib"] ] - let luaXYZ = luaVersion.split(".") let libFile = "lua" + luaXYZ[0] + luaXYZ[1] + ".lib" let dllFile = "lua" + luaXYZ[0] + luaXYZ[1] + ".dll" + objs["lua"] = [ ...objs["lua"], libFile ] + objs["luac"] = [ ...objs["luac"], ...objs["lib"] ] + await msvc_link(luaExtractPath, "link /nologo /DLL", dllFile, objs["lib"]); await msvc_link(luaExtractPath, "link /nologo", "luac.exe", objs["luac"]); await msvc_link(luaExtractPath, "link /nologo", "lua.exe", objs["lua"]); @@ -187,7 +187,7 @@ async function install_plain_lua_windows(luaExtractPath, luaInstallPath, luaVers const luaHpp = (await exists(pathJoin(src, "lua.hpp"))) ? "lua.hpp" : "../etc/lua.hpp" const headers = [ "lua.h", "luaconf.h", "lualib.h", "lauxlib.h", luaHpp ] - await install_files(pathJoin(luaInstallPath, "bin"), luaExtractPath, [ "lua.exe", "luac.exe" ]) + await install_files(pathJoin(luaInstallPath, "bin"), luaExtractPath, [ "lua.exe", "luac.exe", dllFile ]) await install_files(pathJoin(luaInstallPath, "lib"), luaExtractPath, [ dllFile, libFile ]) await install_files(pathJoin(luaInstallPath, "include"), src, headers) }