export luau.dll

This commit is contained in:
Mikulas Florek 2023-10-11 20:30:06 +02:00
parent 4303389c5d
commit ac0ad04e7a
3 changed files with 24 additions and 1 deletions

View File

@ -747,6 +747,10 @@ if has_plugin("lua_script") then
project "lua_script"
libType()
if force_build_luau and not force_build_luau_dynamic then
defines { "LUMIX_STATIC_LUAU" }
end
files { "../src/lua_script/**.h", "../src/lua_script/**.cpp" }
includedirs { "../src", "../src/lua_script" }
defines { "BUILDING_LUA_SCRIPT" }

View File

@ -323,6 +323,25 @@ struct StudioLuaPlugin : StudioApp::GUIPlugin {
return false;
}
bool exportData(const char* dest_dir) override
{
#ifndef LUMIX_STATIC_LUAU
char exe_path[MAX_PATH];
os::getExecutablePath(Span(exe_path));
char exe_dir[MAX_PATH];
copyString(Span(exe_dir), Path::getDir(exe_path));
StaticString<MAX_PATH> tmp(exe_dir, "Luau.dll");
if (!os::fileExists(tmp)) return false;
StaticString<MAX_PATH> dest(dest_dir, "Luau.dll");
if (!os::copyFile(tmp, dest))
{
logError("Failed to copy ", tmp, " to ", dest);
return false;
}
#endif
return true;
}
void onGUI() override {
lua_State* L = m_app.getEngine().getState();

View File

@ -948,7 +948,7 @@ struct PipelineImpl final : Pipeline
if (errors)
{
logError(m_resource->getPath(), ": ", lua_tostring(m_lua_state, -1));
lua_pop(m_lua_state, 1);
lua_pop(m_lua_state, 2);
return;
}