1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-19 08:30:25 +02:00

Disable LTO for wasm release

This commit is contained in:
Brian Fiete 2023-07-27 07:16:00 -07:00
parent 61790dd09b
commit 145ba4b0a3
2 changed files with 15 additions and 14 deletions

View file

@ -7,8 +7,15 @@ namespace IDE
{
public enum LTOType
{
None,
Thin,
case None;
case Thin;
public static LTOType GetDefaultFor(Workspace.PlatformType platformType, bool isRelease)
{
if ((platformType == .Windows) && (isRelease))
return .Thin;
return .None;
}
}
public enum EmitDebugInfo

View file

@ -103,7 +103,7 @@ namespace IDE
case iOS;
case Android;
case Wasm;
public static PlatformType GetFromName(StringView name, StringView targetTriple = default)
{
if (!targetTriple.IsWhiteSpace)
@ -801,7 +801,7 @@ namespace IDE
data.ConditionalAdd("BfOptimizationLevel", options.mBfOptimizationLevel, isRelease ? .O2 : (platformName == "Win64") ? .OgPlus : .O0);
else
data.ConditionalAdd("BfOptimizationLevel", options.mBfOptimizationLevel, isRelease ? .O2 : .O0);
data.ConditionalAdd("LTOType", options.mLTOType, isRelease ? .Thin : .None);
data.ConditionalAdd("LTOType", options.mLTOType, BuildOptions.LTOType.GetDefaultFor(platformType, isRelease));
data.ConditionalAdd("AllocType", options.mAllocType, isRelease ? .CRT : .Debug);
data.ConditionalAdd("AllocMalloc", options.mAllocMalloc, "");
data.ConditionalAdd("AllocFree", options.mAllocFree, "");
@ -991,16 +991,10 @@ namespace IDE
options.mBfOptimizationLevel = isRelease ? .O2 : .O0;
options.mBfSIMDSetting = .SSE2;
if (platformType == .Windows)
{
options.mLTOType = isRelease ? .Thin : .None;
options.mBfOptimizationLevel = isRelease ? .O2 : (platformName == "Win64") ? .OgPlus : .O0;
options.mToolsetType = isRelease ? .LLVM : .Microsoft;
}
else if ((platformType == .macOS) == (platformType == .Linux))
{
options.mLTOType = isRelease ? .Thin : .None;
options.mToolsetType = isRelease ? .LLVM : .GNU;
}
options.mLTOType = BuildOptions.LTOType.GetDefaultFor(platformType, isRelease);
options.mToolsetType = ToolsetType.GetDefaultFor(platformType, isRelease);
options.mAllocType = isRelease ? .CRT : .Debug;
options.mEmitDebugInfo = .Yes;
@ -1107,7 +1101,7 @@ namespace IDE
else
options.mBfOptimizationLevel = data.GetEnum<BuildOptions.BfOptimizationLevel>("BfOptimizationLevel", isRelease ? .O2 : .O0);
options.mLTOType = data.GetEnum<BuildOptions.LTOType>("LTOType", isRelease ? .Thin : .None);
options.mLTOType = data.GetEnum<BuildOptions.LTOType>("LTOType", BuildOptions.LTOType.GetDefaultFor(platformType, isRelease));
options.mAllocType = data.GetEnum<AllocType>("AllocType", isRelease ? .CRT : .Debug);
data.GetString("AllocMalloc", options.mAllocMalloc);
data.GetString("AllocFree", options.mAllocFree);