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

View File

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

View File

@ -37,6 +37,10 @@ local function auStartSolution(sln)
} }
end end
if (Aurora.Settings.bLTO) then
flags "LinkTimeOptimization"
end
auFilterForPlatforms(function(platform) auFilterForPlatforms(function(platform)
if (platform == "win32") then if (platform == "win32") then
if (not Aurora.Settings.bForceClangWin32) then if (not Aurora.Settings.bForceClangWin32) then

View File

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