11// Copyright 2018 Yassine Riahi and Liam Flookes. Provided under a MIT License, see license file on github.
22// Used to generate a fastbuild .bff file from UnrealBuildTool to allow caching and distributed builds.
3- // Tested with Windows 10, Visual Studio 2015/2017, Unreal Engine 4.18 , FastBuild v0.95
3+ // Tested with Windows 10, Visual Studio 2015/2017, Unreal Engine 4.19.1 , FastBuild v0.95
44// Durango is fully supported (Compiles with VS2015).
55// Orbis will likely require some changes.
66using System ;
@@ -82,7 +82,8 @@ public static bool IsAvailable()
8282 return false ;
8383 }
8484
85-
85+ private HashSet < string > ForceLocalCompileModules = new HashSet < string > ( )
86+ { "Module.ProxyLODMeshReduction" } ;
8687
8788 private enum FBBuildType
8889 {
@@ -105,7 +106,7 @@ private void DetectBuildType(List<Action> Actions)
105106 BuildType = FBBuildType . PS4 ;
106107 return ;
107108 }
108- else if ( action . CommandArguments . Contains ( "XboxOne" ) || action . CommandPath . Contains ( "Durango" ) || action . CommandArguments . Contains ( "Durango ") )
109+ else if ( action . CommandArguments . Contains ( "Intermediate \\ Build \\ XboxOne" ) )
109110 {
110111 BuildType = FBBuildType . XBOne ;
111112 return ;
@@ -142,13 +143,14 @@ public override bool ExecuteActions(List<Action> Actions, bool bLogDetailedActio
142143 string FASTBuildFilePath = Path . Combine ( UnrealBuildTool . EngineDirectory . FullName , "Intermediate" , "Build" , "fbuild.bff" ) ;
143144 if ( CreateBffFile ( Actions , FASTBuildFilePath ) )
144145 {
145- return ExecuteBffFile ( FASTBuildFilePath ) ;
146+ FASTBuildResult = ExecuteBffFile ( FASTBuildFilePath ) ;
146147 }
147148 else
148149 {
149- return false ;
150+ FASTBuildResult = false ;
150151 }
151152 }
153+
152154 return FASTBuildResult ;
153155 }
154156
@@ -480,8 +482,8 @@ private void WriteEnvironmentSetup()
480482 {
481483 // If you have XboxOne source access, uncommenting the line below will be better for selecting the appropriate version of the compiler.
482484 // Translate the XboxOne compiler to the right Windows compiler to set the VC environment vars correctly...
483- // WindowsCompiler windowsCompiler = XboxOnePlatform.GetDefaultCompiler() == XboxOneCompiler.VisualStudio2015 ? WindowsCompiler.VisualStudio2015 : WindowsCompiler.VisualStudio2017;
484- VCEnv = VCEnvironment . SetEnvironment ( CppPlatform . Win64 , WindowsPlatform . GetDefaultCompiler ( null ) ) ;
485+ //WindowsCompiler windowsCompiler = XboxOnePlatform.GetDefaultCompiler() == XboxOneCompiler.VisualStudio2015 ? WindowsCompiler.VisualStudio2015 : WindowsCompiler.VisualStudio2017;
486+ // VCEnv = VCEnvironment.SetEnvironment(CppPlatform.Win64, windowsCompiler );
485487 }
486488 }
487489 catch ( Exception )
@@ -668,6 +670,11 @@ private void AddCompileAction(Action Action, int ActionIndex, List<int> Dependen
668670 AddText ( string . Format ( "\t .CompilerInputFiles = \" {0}\" \n " , InputFile ) ) ;
669671 AddText ( string . Format ( "\t .CompilerOutputPath = \" {0}\" \n " , IntermediatePath ) ) ;
670672
673+ if ( ! Action . bCanExecuteRemotely || ! Action . bCanExecuteRemotelyWithSNDBS || ForceLocalCompileModules . Contains ( Path . GetFileNameWithoutExtension ( InputFile ) ) )
674+ {
675+ AddText ( string . Format ( "\t .AllowDistribution = false\n " ) ) ;
676+ }
677+
671678 string OtherCompilerOptions = GetOptionValue ( ParsedCompilerOptions , "OtherOptions" , Action ) ;
672679 string CompilerOutputExtension = ".unset" ;
673680
0 commit comments