Skip to content

Commit

Permalink
- Fixing the ProxyLODMeshReduction compilation issue: Added an option…
Browse files Browse the repository at this point in the history
… to force local compilation of certain modules.

- "Better" detection of the XboxOne platform (through action command arguments).
  • Loading branch information
YassineTyphoon committed May 7, 2018
1 parent a316508 commit 303a83f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions FASTBuild.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2018 Yassine Riahi and Liam Flookes. Provided under a MIT License, see license file on github.
// Used to generate a fastbuild .bff file from UnrealBuildTool to allow caching and distributed builds.
// Tested with Windows 10, Visual Studio 2015/2017, Unreal Engine 4.18, FastBuild v0.95
// Tested with Windows 10, Visual Studio 2015/2017, Unreal Engine 4.19.1, FastBuild v0.95
// Durango is fully supported (Compiles with VS2015).
// Orbis will likely require some changes.
using System;
Expand Down Expand Up @@ -82,7 +82,8 @@ public static bool IsAvailable()
return false;
}


private HashSet<string> ForceLocalCompileModules = new HashSet<string>()
{"Module.ProxyLODMeshReduction"};

private enum FBBuildType
{
Expand All @@ -105,7 +106,7 @@ private void DetectBuildType(List<Action> Actions)
BuildType = FBBuildType.PS4;
return;
}
else if (action.CommandArguments.Contains("XboxOne") || action.CommandPath.Contains("Durango") || action.CommandArguments.Contains("Durango"))
else if (action.CommandArguments.Contains("Intermediate\\Build\\XboxOne"))
{
BuildType = FBBuildType.XBOne;
return;
Expand Down Expand Up @@ -142,13 +143,14 @@ public override bool ExecuteActions(List<Action> Actions, bool bLogDetailedActio
string FASTBuildFilePath = Path.Combine(UnrealBuildTool.EngineDirectory.FullName, "Intermediate", "Build", "fbuild.bff");
if (CreateBffFile(Actions, FASTBuildFilePath))
{
return ExecuteBffFile(FASTBuildFilePath);
FASTBuildResult = ExecuteBffFile(FASTBuildFilePath);
}
else
{
return false;
FASTBuildResult = false;
}
}

return FASTBuildResult;
}

Expand Down Expand Up @@ -480,8 +482,8 @@ private void WriteEnvironmentSetup()
{
// If you have XboxOne source access, uncommenting the line below will be better for selecting the appropriate version of the compiler.
// Translate the XboxOne compiler to the right Windows compiler to set the VC environment vars correctly...
// WindowsCompiler windowsCompiler = XboxOnePlatform.GetDefaultCompiler() == XboxOneCompiler.VisualStudio2015 ? WindowsCompiler.VisualStudio2015 : WindowsCompiler.VisualStudio2017;
VCEnv = VCEnvironment.SetEnvironment(CppPlatform.Win64, WindowsPlatform.GetDefaultCompiler(null));
//WindowsCompiler windowsCompiler = XboxOnePlatform.GetDefaultCompiler() == XboxOneCompiler.VisualStudio2015 ? WindowsCompiler.VisualStudio2015 : WindowsCompiler.VisualStudio2017;
//VCEnv = VCEnvironment.SetEnvironment(CppPlatform.Win64, windowsCompiler);
}
}
catch (Exception)
Expand Down Expand Up @@ -668,6 +670,11 @@ private void AddCompileAction(Action Action, int ActionIndex, List<int> Dependen
AddText(string.Format("\t.CompilerInputFiles = \"{0}\"\n", InputFile));
AddText(string.Format("\t.CompilerOutputPath = \"{0}\"\n", IntermediatePath));

if(!Action.bCanExecuteRemotely || !Action.bCanExecuteRemotelyWithSNDBS || ForceLocalCompileModules.Contains(Path.GetFileNameWithoutExtension(InputFile)))
{
AddText(string.Format("\t.AllowDistribution = false\n"));
}

string OtherCompilerOptions = GetOptionValue(ParsedCompilerOptions, "OtherOptions", Action);
string CompilerOutputExtension = ".unset";

Expand Down

0 comments on commit 303a83f

Please sign in to comment.