Build/Boilerplate/valaSym2Def.lua
Reece dd109c82cb [+] Base64 utils
[+] Vala compiler support
[+] Improve guess-platform-code
[*] Clean up
2021-09-14 14:15:46 +01:00

26 lines
863 B
Lua

local cia = path.translate(path.join(build.projectRoot, "symbols.CIA"), path.getDefaultSeparator())
local def = path.translate(path.join(build.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 = build.projectName .. "." .. build.platform .. "." .. build.architecture .. ".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)