Skip to content

Commit

Permalink
Fix C module loading on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
leso-kn authored and jkl1337 committed Feb 20, 2024
1 parent df943be commit 8715b3a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ async function install_plain_lua_windows(
}
});

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"]);
Expand All @@ -239,6 +239,7 @@ async function install_plain_lua_windows(
await install_files(pathJoin(luaInstallPath, "bin"), luaExtractPath, [
"lua.exe",
"luac.exe",
dllFile,
]);
await install_files(pathJoin(luaInstallPath, "lib"), luaExtractPath, [
dllFile,
Expand Down

0 comments on commit 8715b3a

Please sign in to comment.