[+] Resource compiler now matches pattern

[*] Reenable vala
This commit is contained in:
Reece Wilson 2022-03-06 17:28:21 +00:00
parent 224618d26d
commit 86059983bc
7 changed files with 79 additions and 42 deletions

View File

@ -94,7 +94,13 @@ if (binScript) then
binSuffx = " " .. args
end
os.exit(os.execute(escapeBinaryPath(path.join(Aurora.Settings.sAbsRoot, binScript)) .. binSuffx))
local cmd = escapeBinaryPath(path.join(Aurora.Settings.sAbsRoot, binScript)) .. binSuffx
if (os.host() == "windows") then
cmd = "call " .. cmd
end
os.exit(os.execute(cmd))
end
local cmd = _OPTIONS["cmd"]

View File

@ -280,19 +280,19 @@ end
local function auBlockProjectKeyDepends(processor, value)
__pushFilter(value, "value", function(obj)
handleDepends(processor, obj, false)
end, processor, true)
end, true)
end
local function auBlockProjectKeyDllimport(processor, value)
__pushFilter(value, "value", defines, processor)
__pushFilter(value, "value", defines, true)
end
local function auBlockProjectKeyDllexport(processor, value)
__pushFilter(value, "value", defines, processor)
__pushFilter(value, "value", defines, true)
end
local function auBlockProjectKeyDllexport(processor, value)
__pushFilter(value, "value", defines, processor)
__pushFilter(value, "value", defines, true)
end
local function auBlockProjectKeyResourceScript(processor, value, map, tasks)
@ -308,37 +308,78 @@ local function auBlockProjectKeyResourceScript(processor, value, map, tasks)
end
local function auBlockProjectKeyProtobuf(processor, value)
__pushFilter(value, "value", auProtobufFiles, processor, true)
__pushFilter(value, "files", auProtobufFiles, true)
end
local function auBlockProjectKeyVala(processor, value)
__pushFilter(value, nil, function(value)
local sources = {}
local gir = Aurora.Settings.sValaGirs
local vapi = Aurora.Settings.aValaDevVApis
local valIncludes = nil
local valGirFile = nil
local header = nil
local name = auGetCurrentProject()
if (auIsArray(value)) then
sources = value
else
gir = auConcatArrays(gir, value.girs)
vapi = auConcatArrays(vapi, value.vapis)
sources = value.sources
valIncludes = path.join(processor:getMeta().path, value.include)
valGirFile = path.join(processor:getMeta().path, value.gir)
header = path.join(processor:getMeta().path, value.header)
if (value.name) then
name = value.name
end
end
local extended =
{
sources = sources,
gir = gir,
vapi = vapi,
vapi = vapi,
package = valIncludes,
header = header,
girFile = valGirFile,
name = name
}
auAddVala(extended)
end, false)
end
local function auBlockProjectKeySoftDepends(processor, value)
__pushFilter(value, "value", function(obj)
handleDepends(processor, obj, true)
end, processor, true)
end, true)
end
local function auBlockProjectRefKeyInclSoftDepends(processor, value, taskMap, taskArray, inc, resolve)
__pushFilter(value, "value", function(obj)
resolve(processor:translateDep(obj), false)
end, processor, true)
end, true)
end
local function auBlockProjectRefKeyInclDepends(processor, value, taskMap, taskArray, inc, resolve)
__pushFilter(value, "value", function(obj)
resolve(processor:translateDep(obj), false)
end, processor, true)
end, true)
end
local function auBlockProjectRefKeyDepends(processor, value, taskMap, taskArray, inc, resolve)
__pushFilter(value, "value", function(obj)
resolve(processor:translateDep(obj), false)
end, processor, true)
end, true)
end
local function auBlockProjectRefKeySoftDepends(processor, value, taskMap, taskArray, inc, resolve)
__pushFilter(value, "value", function(obj)
resolve(processor:translateDep(obj), true)
end, processor, true)
end, true)
end
local function auBlockProjectKeyLua(processor, script)
@ -389,7 +430,8 @@ auProjectBlockHandlers =
actions = auBlockProjectKeyBuildAction,
features = auBlockKeyFeature,
resourceScript = auBlockProjectKeyResourceScript,
protobuf = auBlockProjectKeyProtobuf
protobuf = auBlockProjectKeyProtobuf,
vala = auBlockProjectKeyVala
}
auProjectBlockHandlers["soft-depends"] = auBlockProjectKeySoftDepends
@ -418,7 +460,7 @@ auProjectRefHandlers["depends"] = auBlockProjectRefKeyDepends
"impInclude", "implInclude", "impIncludes", "implIncludes", "clangIgnore",
"msvcIgnore", "excludes", "depends", "require",
"eval", "lua", "events", "actions", "staticImpDefines", "features",
"links", "soft-depends", "resourceScript", "protobuf"
"links", "soft-depends", "resourceScript", "protobuf", "vala"
}
local kReferenceTasks = {"eval", "includes", "include", "includes"} --, "features"}

View File

@ -236,28 +236,6 @@ function JsonProcessor(info)
auForEach(result.dllexport, defines)
end
end
if (result.valaSrc) then
local sources = result.valaSrc
local gir = auConcatArrays(auValaGirs, result.valaGirs)
local vapi = auConcatArrays(auValaDevVApis, result.valaDevVApis)
local valIncludes = result.valaInclude
local valGirFile = result.valGirFile
local header = result.valaHeader
local name = result.valaName
local extended =
{
sources = sources,
gir = gir,
vapi = vapi,
vapi = vapi,
package = valIncludes,
header = header,
girFile = valGirFile,
name = name
}
valaGo(extended)
end
end
auForEach(result.subprojs, function(subproj)

View File

@ -4,8 +4,10 @@ local function resourceCompile(files, additional, script)
local absFiles = {}
auForEach(files, function(file)
auForEach(os.matchfiles(file), function(file)
table.insert(absFiles, os.realpath(file))
end)
end)
local cur = auGetCurrentProjectMeta()
local projScript = nil

View File

@ -4,7 +4,7 @@ end
local function findVala()
if (isWin32()) then
local auValac = Aurora.Settings.sAbsValac or path.join(Aurora.Settings.sAbsRoot, Aurora.Settings.sRelWin32, "\\Vala\\valac.exe")
local auValac = Aurora.Settings.sAbsValac or path.join(Aurora.Settings.sAbsWin32, "valac.exe")
if (os.isfile(auValac)) then return auValac end
local drive = path.getdrive(auGetRoot())
@ -83,16 +83,12 @@ local function addVala(extended)
local function onSourceFile(partial)
local path = expandPartialNonExistsFile(partial)
--print("vala source", path)
args = args .. " \"".. path .. "\""
local cfile = path:gsub("%.vala", "") .. ".c"
--print("vala c", cfile)
files(cfile)
if (usingMSVC) then
files(path)
end
end
local function onSourcePattern(pattern)
auForEach(os.matchfiles(pattern), onSourceFile)

View File

@ -4,6 +4,7 @@ local target = auRequire("Core/Target")
local main = auRequire("Core/Main")
local resourceCompiler = auRequire("Core/ResourceCompiler")
local protobuf = auRequire("Core/Protobuf")
local vala = auRequire("Core/Vala")
-- executes inline under iprocessor::process
function auAddBuildAction(...)
@ -160,3 +161,7 @@ end
function auProtobufFiles(files)
protobuf(files)
end
function auAddVala(info)
vala(info)
end

View File

@ -112,3 +112,11 @@ auSetDefault(settings, "sDefaultCmakePremakeBin", "premake5")
-- V8 took minutes to start up on an i9-9900k, QST/VM tests result in highs of ~30MB/s down from 900MB/s
-- MSVCs justmycode implementation is not fit for use.
auSetDefault(settings, "bHotswap", false)
if (os.host() == "windows") then
auSetDefault(settings, "sValaGirs", "C:\\msys64\\mingw64\\share\\gir-1.0")
auSetDefault(settings, "aValaDevVApis", {"C:\\msys64\\mingw64\\share\\vala\\vapi", "C:\\msys64\\mingw64\\share\\vala-0.54\\vapi"})
else
auSetDefault(settings, "sValaGirs", "/usr/share/gir-1.0")
auSetDefault(settings, "aValaDevVApis", {"/usr/share/vala/vapi", "/usr/share/vala-0.54/vapi"})
end