[*] updated tsc support

This commit is contained in:
Reece Wilson 2023-03-05 20:38:25 +00:00
parent a690db833d
commit 4f34946f1d
4 changed files with 68 additions and 9 deletions

View File

@ -437,6 +437,14 @@ local function auBlockProjectKeyBigObject(processor, value)
end)
end
local function auBlockProjectKeyBigRtti(processor, value)
if (value) then
rtti "On"
else
rtti "Off"
end
end
local auProjectHeaderHandlers =
{
linkDepends = auHeaderProjectKeyLinkDepends,
@ -480,7 +488,8 @@ auProjectBlockHandlers =
vala = auBlockProjectKeyVala,
unpack = auBlockProjectKeyUnpack,
m4 = auBlockProjectKeyM4,
bigObject = auBlockProjectKeyBigObject
bigObject = auBlockProjectKeyBigObject,
rtti = auBlockProjectKeyRtti
}
auProjectBlockHandlers["soft-depends"] = auBlockProjectKeySoftDepends

View File

@ -14,12 +14,14 @@ local function processJson(meta, object, result)
object.targetVersion = result.target or "esnext"
object.module = result.moduleLoader or "esnext"
object.moduleDetection = result.moduleDetection or "force"
object.base = result.base
object.exportIDE = result.exportIDE
object.bundle = result.bundle
object.typeDirs = result.typeDirs
object.sources = result.sources
object.depends = result.depends
object.depends2 = result.depends2
object.removeComments = result.removeComments
object.flags = result.flags or {}
@ -70,6 +72,8 @@ local function processProject(meta, object)
args = args .. ' --sourceMap'
args = args .. ' --declarationMap'
args = args .. ' --inlineSources'
args = args .. ' --module ' .. object.module
args = args .. ' --moduleDetection ' .. object.moduleDetection
args = args .. ' --sourceRoot \"' .. rootdir .. "\""
args = args .. ' --mapRoot \"' .. path.normalize(symPath) .. "\""
args = args .. ' --rootDir \"' .. rootdir .. "\""
@ -91,18 +95,53 @@ local function processProject(meta, object)
end
local typeDirs = {}
if (object.depends) then
if (object.depends ) then
auForEach(object.depends, function(dependency)
local typeDir = path.normalize(path.join(linkPath2, dependency))
table.insert(typeDirs, typeDir)
end)
end
if (object.depends2) then
auForEach(object.depends2, function(dependency)
local typeDir = path.normalize(path.join(linkPath2, dependency))
table.insert(typeDirs, typeDir)
end)
end
local ew = ""
local ew2 = {}
if (object.depends or object.depends2) then
args = args .. ' --typeRoots "'
auForEach(object.depends, function(dependency)
local typeDir = path.join(linkPath2, dependency)
table.insert(typeDirs, typeDir)
args = args .. typeDir .. ","
auForEach(typeDirs, function(dependency)
args = args .. path.normalize(dependency) .. "\",\""
table.insert(ew2, dependency .. "/**/*.d.ts")
table.insert(ew2, dependency .. "/*.d.ts")
auForEach(os.matchfiles(dependency .. "/**.d.ts"), function(file)
ew = ew .. " \"" .. file .. "\""
end)
end)
args = args .. '"'
args = args .. ew
end
args = args:gsub(",\"\"", "")
local ew3 = {}
auForEach(object.sources, function(func)
table.insert(ew3, rootdir .. "/" .. func:gsub("%*%*.", "**/*."))
table.insert(ew3, rootdir .. "/" .. func:gsub("%*%*.", "*."))
end)
auAddBuildAction("pre", "cmd", "tsc", false, args)
@ -177,14 +216,16 @@ local function processProject(meta, object)
auMergeTable(compilerOptions, object.flags)
compilerOptions.typeRoots = typeDirs
compilerOptions.target = object.targetVersion
compilerOptions.module = object.module
compilerOptions.moduleDetection = object.moduleDetection
local IDE = {
autogeneratedfile = "DO NOT MODIFY OR ATTEMPT TO COMPILE. IDE LINT, TOOLTIP, AND AUTOCOMPLETE USAGE ONLY",
files = object.files,
include = auMergeArray(ew3, ew2),
compilerOptions = compilerOptions
}
io.writefile("tsconfig.json", json.encode(IDE))
io.writefile("tsconfig.json", json.encode(IDE, 4))
files "tsconfig.json"
end
end

View File

@ -36,7 +36,11 @@ local function auStartSolution(sln)
"MultiProcessorCompile"
}
end
if (Aurora.Settings.bLTO) then
flags "LinkTimeOptimization"
end
auFilterForPlatforms(function(platform)
if (platform == "win32") then
if (not Aurora.Settings.bForceClangWin32) then

View File

@ -94,8 +94,13 @@ auSetDefault(settings, "bDefinePartialABIInTargetName", true)
auSetDefault(settings, "bStaticRuntime", true)
--
auSetDefault(settings, "bLTO", false)
--
auSetDefault(settings, "bEditAndCont", false)
--
auSetDefault(settings, "bSplitTargetDirByArch", false)