This commit is contained in:
Reece Wilson 2023-08-23 21:55:40 +01:00
parent e6fa5fb2ed
commit 326b95c638

View File

@ -456,6 +456,41 @@ local kAllProjectHeaders =
"linkDepends", "includeDepends"
}
local function auBlockProjectKeyLtoNotMsvc(processor, value)
if (value) then
auFilter{"toolset:clang", "not system:windows"}
--buildoptions "-flto=thin"
--linkoptions "-Wl,-mllvm,-threads=4"
buildoptions "-flto"
linkoptions "-flto"
auFilter{}
end
end
local function auBlockProjectKeyLtoMsvc(processor, value)
if (value) then
auFilter{"toolset:msc"}
--linkoptions "/LTCG"
flags { "LinkTimeOptimization" }
flags { "NoIncrementalLink" }
buildoptions "/GL"
auFilter{}
end
end
local function auBlockProjectKeyLtoClang(processor, value)
auBlockProjectKeyLtoNotMsvc(processor, value)
end
local function auBlockProjectKeyLtoNotClang(processor, value)
auBlockProjectKeyLtoMsvc(processor, value)
end
local function auBlockProjectKeyLto(processor, value)
auBlockProjectKeyLtoMsvc(processor, value)
auBlockProjectKeyLtoNotMsvc(processor, value)
end
auProjectBlockHandlers =
{
links = auBlockProjectKeyLinks,
@ -489,7 +524,12 @@ auProjectBlockHandlers =
unpack = auBlockProjectKeyUnpack,
m4 = auBlockProjectKeyM4,
bigObject = auBlockProjectKeyBigObject,
rtti = auBlockProjectKeyRtti
rtti = auBlockProjectKeyRtti,
lto = auBlockProjectKeyLto,
ltoNotMsvc = auBlockProjectKeyLtoNotMsvc,
ltoNotClang = auBlockProjectKeyLtoNotClang,
ltoMsvc = auBlockProjectKeyLtoMsvc,
ltoClang = auBlockProjectKeyLtoClang
}
auProjectBlockHandlers["soft-depends"] = auBlockProjectKeySoftDepends
@ -520,7 +560,8 @@ kGenericTasks = {
"msvcIgnore", "excludes", "depends", "require", "m4", "vala",
"eval", "lua", "events", "actions", "staticImpDefines", "features",
"links", "soft-depends", "resourceScript", "protobuf", "unpack",
"bigObject", "rtti"
"bigObject", "rtti", "lto", "ltoNotMsvc", "ltoNotClang", "ltoMsvc",
"ltoClang"
}
local kReferenceTasks = {"eval", "includes", "defines", "include", "includes", "protobuf", "actions"} --, "features"}