[*] Turns out half of the script hack was necessary for multi-arch

This commit is contained in:
Reece Wilson 2022-01-18 20:48:06 +00:00
parent 6620dd54f2
commit 1f8f43a8e1
3 changed files with 44 additions and 18 deletions

View File

@ -27,28 +27,42 @@ local function start()
addTarget("target", Aurora.Platforms, _auCurrentPlatforms) addTarget("target", Aurora.Platforms, _auCurrentPlatforms)
addTarget("target", Aurora.Architectures, _auCurrentArchs) addTarget("target", Aurora.Architectures, _auCurrentArchs)
addTarget("flag", Aurora.Flags, _auCurrentFlags) addTarget("flag", Aurora.Flags, _auCurrentFlags)
_auExtendedArch = #_auCurrentArchs > 1
end end
local function startProject() local function startProject()
auFilterForConfigPlatforms(function(config, platform, architecture) --_G.architecture("x86_64")
auFilterForConfigPlatforms(function(config, platform)
if (not _auExtendedArch) then
local architecture = _auCurrentArchs[1]
auFilter {}
auFilter ("configurations:" .. config)
_G.architecture(Aurora.Architectures[architecture].architecture) _G.architecture(Aurora.Architectures[architecture].architecture)
defines(Aurora.Platforms[platform].defines) defines(Aurora.Platforms[platform].defines)
else
auFilter {}
auForEach(_auCurrentArchs, function(architecture)
auFilter ("configurations:" .. config .. architecture)
_G.architecture(Aurora.Architectures[architecture].architecture)
defines(Aurora.Platforms[platform].defines)
auFilter {}
end)
auFilter ("platform:none")
end
end) end)
end end
local function startSolution() local function startSolution()
local configs = {} local configs = {}
if (not _auExtendedConfig and not _auExtendedArch) then if (not _auExtendedArch) then
auForEach(Aurora.Settings.aNamesOfConfigs, function(config) auForEach(Aurora.Settings.aNamesOfConfigs, function(config)
table.insert(configs, config) table.insert(configs, config)
end) end)
else else
auForEach(_auCurrentPlatforms, function(platform)
auForEach(_auCurrentArchs, function(arch) auForEach(_auCurrentArchs, function(arch)
auForEach(Aurora.Settings.aNamesOfConfigs, function(config) auForEach(Aurora.Settings.aNamesOfConfigs, function(config)
table.insert(configs, platform .. arch .. config) table.insert(configs, config .. arch)
end)
end) end)
end) end)
end end
@ -134,7 +148,13 @@ local function auFilterOf(configFilter, ...)
return return
end end
if (not _auExtendedArch) then
table.insert(validConfigs, config) table.insert(validConfigs, config)
else
auForEach(_auCurrentArchs, function(arch)
table.insert(validConfigs, config .. arch)
end)
end
end) end)
auForEach(_auCurrentArchs, function(arch) auForEach(_auCurrentArchs, function(arch)
@ -168,7 +188,7 @@ local function auFilterOf(configFilter, ...)
if (#supportedArchs == 0) then if (#supportedArchs == 0) then
table.insert(supportedArchs, "platforms:none") table.insert(supportedArchs, "platforms:none")
end end
ret = table.concat(supportedArchs, " or ") ret = {table.concat(supportedArchs, " or ")}
local supportedPlatforms = {} local supportedPlatforms = {}
auForEach(validPlatforms, function(platform) auForEach(validPlatforms, function(platform)
@ -177,7 +197,7 @@ local function auFilterOf(configFilter, ...)
if (#supportedPlatforms == 0) then if (#supportedPlatforms == 0) then
table.insert(supportedPlatforms, "platforms:none") table.insert(supportedPlatforms, "platforms:none")
end end
ret = auConcatVararg(ret, {table.concat(supportedPlatforms, " or ")}) ret = auMergeArray(ret, {table.concat(supportedPlatforms, " or ")})
local supportedConfigs = {} local supportedConfigs = {}
@ -187,11 +207,11 @@ local function auFilterOf(configFilter, ...)
if (#supportedConfigs == 0) then if (#supportedConfigs == 0) then
table.insert(supportedConfigs, "platforms:none") table.insert(supportedConfigs, "platforms:none")
end end
ret = auConcatVararg(ret, {table.concat(supportedConfigs, " or ")}) ret = auMergeArray(ret, {table.concat(supportedConfigs, " or ")})
--local ret = {table.concat(ret, " or ")} --local ret = {table.concat(ret, " or ")}
if (#andOptions) then if (#andOptions) then
ret = auConcatVararg(ret, andOptions) ret = auMergeArray(ret, andOptions)
end end
--print(json.encode(configFilter), json.encode(ret)) --print(json.encode(configFilter), json.encode(ret))

View File

@ -374,7 +374,8 @@ local function linkAuProject(dep, soft)
end end
local function addFeature(feature) local function addFeature(feature)
print("adding feature ", feature) --print("adding feature ", feature)
local script = auGetRoot() .. "/Build_Scripts/Features/" .. feature:lower() .. ".lua" local script = auGetRoot() .. "/Build_Scripts/Features/" .. feature:lower() .. ".lua"
if (not os.isfile(script)) then if (not os.isfile(script)) then

View File

@ -25,7 +25,6 @@ function auStart()
end end
function auStartSolution(sln) function auStartSolution(sln)
auStart()
auRequire("Core").solution.start(sln) auRequire("Core").solution.start(sln)
end end
@ -91,8 +90,14 @@ function auFilter(filter)
else else
table.insert(tbl, filter) table.insert(tbl, filter)
end end
--print("FILTERING ", json.encode(tbl), json.encode(filter)) local filterArray = {}
_G.filter(tbl)
auForEach(tbl, function(val)
filterArray = auMergeArray(filterArray, val)
end)
--print("FILTERING ", json.encode(filterArray), json.encode(filter))
_G.filter(filterArray)
end end
function auLinkProject(...) function auLinkProject(...)