XMake: update SPIRV and Unicode data parsers

This commit is contained in:
Jérôme Leclercq
2021-10-26 11:14:20 +02:00
parent 14fb2b83ae
commit 8d5276ddac
5 changed files with 4121 additions and 653 deletions

View File

@@ -78,14 +78,17 @@ local DirectionToString = {}
local unicodeSet = {}
io.write("Downloading UnicodeData grammar... ")
io.flush()
local tempUnicodeFile = os.tmpfile() .. ".UnicodeData.txt"
http.download(unicodeDataURL, tempUnicodeFile)
print("Done")
io.flush()
io.write("Parsing... ")
io.flush()
local file = io.open(tempUnicodeFile, "r")
@@ -163,8 +166,10 @@ local DirectionToString = {}
end
print("Parsed " .. #characters .. " characters")
io.flush()
print("Writting Unicode Data to header...")
io.flush()
file = io.open("src/Nazara/Core/UnicodeData.hpp", "w+")
if (not file) then
@@ -172,6 +177,15 @@ local DirectionToString = {}
return
end
file:write([[
// this file was automatically generated and should not be edited
// Copyright (C) ]] .. os.date("%Y") .. [[ Jérôme Leclercq
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp"
]])
file:write(string.format("UnicodeCharacter unicodeCharacters[%d] = {\n", #characters))
for _, data in pairs(characters) do
@@ -227,4 +241,5 @@ local DirectionToString = {}
file:close()
print("Succeeded!")
io.flush()
end)