Build/Core/Vala/valaSym2Def.lua
2022-03-04 17:09:10 +00:00

26 lines
820 B
Lua

local cia = path.translate(path.join(auBuild.projectRoot, "symbols.CIA"), path.getDefaultSeparator())
local def = path.translate(path.join(auBuild.projectRoot, "symbols.def"), path.getDefaultSeparator())
print("Generating MSVC def file for scuffed gnome vala build", cia, def)
local ciaData = io.readfile(cia)
local exports = {}
for s in ciaData:gmatch("[^\r\n]+") do
table.insert(exports, s)
end
-- so, we can't pull the target module name until we've actually built the binary
-- we'll just have to guess for now
local dllName = auBuild.projectTargetName .. ".dll"
local buffer = ""
buffer = buffer .. "LIBRARY " .. dllName .. "\r\n"
buffer = buffer .. "EXPORTS"
local function processExport(export)
buffer = buffer .. "\r\n " .. export
end
forEach(exports, processExport)
io.writefile(def, buffer)