mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 16:40:26 +02:00
Disable LTO for wasm release
This commit is contained in:
parent
61790dd09b
commit
145ba4b0a3
2 changed files with 15 additions and 14 deletions
|
@ -7,8 +7,15 @@ namespace IDE
|
||||||
{
|
{
|
||||||
public enum LTOType
|
public enum LTOType
|
||||||
{
|
{
|
||||||
None,
|
case None;
|
||||||
Thin,
|
case Thin;
|
||||||
|
|
||||||
|
public static LTOType GetDefaultFor(Workspace.PlatformType platformType, bool isRelease)
|
||||||
|
{
|
||||||
|
if ((platformType == .Windows) && (isRelease))
|
||||||
|
return .Thin;
|
||||||
|
return .None;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum EmitDebugInfo
|
public enum EmitDebugInfo
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace IDE
|
||||||
case iOS;
|
case iOS;
|
||||||
case Android;
|
case Android;
|
||||||
case Wasm;
|
case Wasm;
|
||||||
|
|
||||||
public static PlatformType GetFromName(StringView name, StringView targetTriple = default)
|
public static PlatformType GetFromName(StringView name, StringView targetTriple = default)
|
||||||
{
|
{
|
||||||
if (!targetTriple.IsWhiteSpace)
|
if (!targetTriple.IsWhiteSpace)
|
||||||
|
@ -801,7 +801,7 @@ namespace IDE
|
||||||
data.ConditionalAdd("BfOptimizationLevel", options.mBfOptimizationLevel, isRelease ? .O2 : (platformName == "Win64") ? .OgPlus : .O0);
|
data.ConditionalAdd("BfOptimizationLevel", options.mBfOptimizationLevel, isRelease ? .O2 : (platformName == "Win64") ? .OgPlus : .O0);
|
||||||
else
|
else
|
||||||
data.ConditionalAdd("BfOptimizationLevel", options.mBfOptimizationLevel, isRelease ? .O2 : .O0);
|
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("AllocType", options.mAllocType, isRelease ? .CRT : .Debug);
|
||||||
data.ConditionalAdd("AllocMalloc", options.mAllocMalloc, "");
|
data.ConditionalAdd("AllocMalloc", options.mAllocMalloc, "");
|
||||||
data.ConditionalAdd("AllocFree", options.mAllocFree, "");
|
data.ConditionalAdd("AllocFree", options.mAllocFree, "");
|
||||||
|
@ -991,16 +991,10 @@ namespace IDE
|
||||||
options.mBfOptimizationLevel = isRelease ? .O2 : .O0;
|
options.mBfOptimizationLevel = isRelease ? .O2 : .O0;
|
||||||
options.mBfSIMDSetting = .SSE2;
|
options.mBfSIMDSetting = .SSE2;
|
||||||
if (platformType == .Windows)
|
if (platformType == .Windows)
|
||||||
{
|
|
||||||
options.mLTOType = isRelease ? .Thin : .None;
|
|
||||||
options.mBfOptimizationLevel = isRelease ? .O2 : (platformName == "Win64") ? .OgPlus : .O0;
|
options.mBfOptimizationLevel = isRelease ? .O2 : (platformName == "Win64") ? .OgPlus : .O0;
|
||||||
options.mToolsetType = isRelease ? .LLVM : .Microsoft;
|
|
||||||
}
|
options.mLTOType = BuildOptions.LTOType.GetDefaultFor(platformType, isRelease);
|
||||||
else if ((platformType == .macOS) == (platformType == .Linux))
|
options.mToolsetType = ToolsetType.GetDefaultFor(platformType, isRelease);
|
||||||
{
|
|
||||||
options.mLTOType = isRelease ? .Thin : .None;
|
|
||||||
options.mToolsetType = isRelease ? .LLVM : .GNU;
|
|
||||||
}
|
|
||||||
|
|
||||||
options.mAllocType = isRelease ? .CRT : .Debug;
|
options.mAllocType = isRelease ? .CRT : .Debug;
|
||||||
options.mEmitDebugInfo = .Yes;
|
options.mEmitDebugInfo = .Yes;
|
||||||
|
@ -1107,7 +1101,7 @@ namespace IDE
|
||||||
else
|
else
|
||||||
options.mBfOptimizationLevel = data.GetEnum<BuildOptions.BfOptimizationLevel>("BfOptimizationLevel", isRelease ? .O2 : .O0);
|
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);
|
options.mAllocType = data.GetEnum<AllocType>("AllocType", isRelease ? .CRT : .Debug);
|
||||||
data.GetString("AllocMalloc", options.mAllocMalloc);
|
data.GetString("AllocMalloc", options.mAllocMalloc);
|
||||||
data.GetString("AllocFree", options.mAllocFree);
|
data.GetString("AllocFree", options.mAllocFree);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue