Feature Request: Build non-project-specific tools with ue4 build
See original GitHub issueRight now, ue4 build prepends the project name to the provided target.
We have special-case code to build ShaderCompilerWorker (from #14) but no way to do such compilation in general.
In my immediate use-case, I was trying to compile UnrealFrontend.
PS > ue4 build Development UnrealFrontend
Using user-specified engine root: D:\Project
Creating makefile for ProjectUnrealFrontend (no existing makefile)
ERROR: Couldn't find target rules file for target 'ProjectUnrealFrontend' in rules assembly 'UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Location: D:\Project\Engine\Intermediate\Build\BuildRules\UE4Rules.dll
Target rules found:
Traceback (most recent call last):
...
Exception: child process ['D:\\Project\\Engine\\Build\\BatchFiles\\Build.bat', 'ProjectUnrealFrontend', 'Win64', 'Development', '-project=D:\\Project\\project\\Project.uproject'] failed with exit code 5
Taking the command-line that was generated and removing the project name from the target name was sufficient to make this work, e.g.,
D:\\Project\\Engine\\Build\\BatchFiles\\Build.bat UnrealFrontend Win64 Development -project=D:\\Project\\project\\Project.uproject
That would have worked without -project too, I was just looking for the minimal patch. I’m honestly not sure if every Target in a project needs to start with (or equal) the project name, or if that’s just convention for the game-variant and editor builds.
Possible UX:
ue4 build Development -istool UnrealFrontend
I’m not sure what the right command-line option would be in this case.
Another option is -noproject (which would also exclude -project from UBT like we do for ShaderCompileWorker now) but that would block targets in the project that do not include the name of the project as a prefix, I think.
It might also be possible to get UE4BuildTool to list the possible targets, and then automatically recognise when a target needs the Project prefix added, in which case -noproject is a better option.
Edit: I was looking at TargetDescriptor.cs, and the way this tool currently takes ‘Game’, ‘Editor’, ‘Client’, ‘Server’ is actually something we could pass verbatim to -TargetType=, and then the flag for this feature request would be -explicittarget to indicate to pass the given name to -Target, i.e.
# These two build the same thing, from ProjectEditor.Target.cs, which specifies `Type = TargetType.Editor`.
# -TargetType requires a -project
PS> D:\Project\Engine\Build\BatchFiles\Build.bat -TargetType=Editor Win64 Development -project=D:\\Project\\project\\Project.uproject
PS> D:\Project\Engine\Build\BatchFiles\Build.bat -Target=ProjectEditor Win64 Development -project=D:\\Project\\project\\Project.uproject
# This builds shadercompileworker. -project is unnecessary for this particular instance, but you can't tell that without parsing the rules assembly for NativeTargets.
PS> D:\Project\Engine\Build\BatchFiles\Build.bat -Target=ShaderCompileWorker Win64 Development -project=D:\\Project\\project\\Project.uproject
-Target and -TargetType were introduced in UE4.20 though, replacing the existing code which generally concatenated the project name and the target name. So they might not be feasible for ue4cli, depending on how far back it needs to support UE4.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (6 by maintainers)

Top Related StackOverflow Question
Well, that’s just plain flying in the face of established conventions. I wonder if that project breaks any of the Unreal Engine’s own tooling with that naming scheme. Is UAT even able to package that project correctly if the
-noclient -serverflags are specified?So I’ve just hit another corner-case related to this request. The UE Shooter Game example includes the following:
Using
ue4 build, only “Editor” works, as the others are trying to prependShooterGame, but the files are justShooter. >_< Unlike the original request, these would need the-Projectflag.works, as you’d expect.