Ok so doing this in a 4.22 project so its a Unreal’s clang version and build tools have updated slightly, but basically got something running by copying MyProject.Target.cs into the Engine/Source folder, placed my projects Source folder into Engine/Source/Programs/MyProject so that the MyProject.Build.cs was located below that folder as it would have been in my Source folder.
Altered MyProject.Target.cs to have
using UnrealBuildTool;
using System.Collections.Generic;
public class MyProjectTarget : TargetRules
{
public MyProjectTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
BuildEnvironment = TargetBuildEnvironment.Shared;
bBuildAllModules = true;
ExtraModuleNames.AddRange( new string[] { "MyProject" } );
}
}
Created two folders to capture my output and input in,
D:/UnrealEngine/Output/
D:/UnrealEngine/Input/
Then I was able to run the tool using the arguments
-Mode=Optimize -Target=MyProject -Platform=Linux -Configuration=Development -WorkingDir=D:\UnrealEngine\Working -OutputDir=D:\UnrealEngine\Output -InputDir=D:\UnrealEngine\UnrealEngine-release -SourceFiles=@D:\UnrealEngine\Working\Filter.txt -SkipCycleCheck -SkipDiagnostics -CleanTaskList
Then I had to step through some catch-22’s with the tool, so that the following lines were updated.
CompileEnvironment.cs
Line 317: Environment.ForceIncludeFiles.Add(new FileReference(Tokens[Idx].Substring(3)));
Line 346: if(!SourceFile.HasExtension(".a") && !SourceFile.HasExtension(".exe"))
Line 372: else if(FileName == "clang++.exe" || FileName == "clang++")
My Input folder has a Filter.txt item in it
\Engine\Source\Programs\GoblinsOfElderstone\...
-\Engine\Source\Developer\...
-\Engine\Source\Editor\...
-\Engine\Source\Runtime\...
-\Engine\Source\ThirdParty\...
And now I’m stuck again, my project finally gets as far as having a valid TaskList, cross references it successfully with my filter list ( had to use the cmd args -SkipCycleCheck -SkipDiagnostics for pieces of code here, that failed and I didn’t think I needed… ) and I finally get to the big boy, bool bResult = ProcessSequenceTree and some probes get successfully made and then…
Creating probes...
[00:00:00] Creating probes... (1/1220; 0%)
[00:00:08] Creating probes... (212/1220; 17%)
[00:00:14] Creating probes... (390/1220; 31%)
[00:00:23] Creating probes... (920/1220; 75%)
[00:00:29] Creating probes... (1190/1220; 97%)
[00:00:29] Creating probes... (1220/1220; 100%)
[00:00:29] Optimize < > 3/1220 probes, 12 active, 3/622784 fragments (0%)
Failed to compile Platform.3of7.h, exit code -1:
> Compiling attempt 0...
> Compiler=C:\UnrealToolchains\v13_clang-7.0.1-centos7\x86_64-unknown-linux-gnu\bin\clang++
> Dependencies=(2, 6, 7)
> Permutation=(0, 1, 2, 3, 4, 5, 6, 7)
> PotentialDepdendencyCounts=(0, 1, 2, 4, 5, 6)
> MinRequired=0, Pivot=5, MaxRequired=5
> In file included from D:/UnrealEngine/Working/Intermediate/Platform.3of7.h.permutation:9:
> D:\UnrealEngine\Working\Fragments\Platform.1of7.h(142,7): err: 'PLATFORM_COMPILER_CLANG' is not defined, evaluates to 0 [-Werror,-Wundef]
> #elif PLATFORM_COMPILER_CLANG
> ^
> D:\UnrealEngine\Working\Fragments\Platform.1of7.h(676,5): err: 'PLATFORM_COMPILER_HAS_TCHAR_WMAIN' is not defined, evaluates to 0 [-Werror,-Wundef]
> #if PLATFORM_COMPILER_HAS_TCHAR_WMAIN
> ^
> D:\UnrealEngine\Working\Fragments\Platform.1of7.h(899,6): err: 'PLATFORM_TCHAR_IS_CHAR16' is not defined, evaluates to 0 [-Werror,-Wundef]
> #if PLATFORM_TCHAR_IS_CHAR16
> ^
> In file included from D:/UnrealEngine/Working/Intermediate/Platform.3of7.h.permutation:17:
> D:\UnrealEngine\Working\Fragments\Platform.2of7.h(142,7): err: 'PLATFORM_COMPILER_CLANG' is not defined, evaluates to 0 [-Werror,-Wundef]
> #elif PLATFORM_COMPILER_CLANG
> ^
> D:\UnrealEngine\Working\Fragments\Platform.2of7.h(676,5): err: 'PLATFORM_COMPILER_HAS_TCHAR_WMAIN' is not defined, evaluates to 0 [-Werror,-Wundef]
> #if PLATFORM_COMPILER_HAS_TCHAR_WMAIN
> ^
> D:\UnrealEngine\Working\Fragments\Platform.2of7.h(899,6): err: 'PLATFORM_TCHAR_IS_CHAR16' is not defined, evaluates to 0 [-Werror,-Wundef]
> #if PLATFORM_TCHAR_IS_CHAR16
> ^
> In file included from D:/UnrealEngine/Working/Intermediate/Platform.3of7.h.permutation:20:
> D:\UnrealEngine\Working\Fragments\Platform.3of7.h(142,7): err: 'PLATFORM_COMPILER_CLANG' is not defined, evaluates to 0 [-Werror,-Wundef]
> #elif PLATFORM_COMPILER_CLANG
> ^
A whole bunch of clang errors that I got no fking idea how to fix 