Skip to content

Commit

Permalink
Ensure ShaderCompileWorker is built when building Editor modules usin…
Browse files Browse the repository at this point in the history
…g source builds of the Engine
  • Loading branch information
adamrehn committed Mar 12, 2020
1 parent a5ce04e commit 259d03c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions ue4cli/UnrealManagerBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,16 @@ def buildDescriptor(self, dir=os.getcwd(), configuration='Development', target='
if configuration not in self.validBuildConfigurations():
raise UnrealManagerException('invalid build configuration "' + configuration + '"')

# Check if the user specified the `-notools` flag to opt out of building Engine tools when working with source builds
unstripped = list(args)
args = Utility.stripArgs(args, ['-notools'])
noTools = len(unstripped) > len(args)

# If we're using a source build of the Engine then make sure ShaderCompileWorker is built before building project Editor modules
if noTools == False and self.isInstalledBuild() == False and self.isProject(descriptor) and target == 'Editor':
Utility.printStderr('Ensuring ShaderCompileWorker is built before building project Editor modules...')
self._runUnrealBuildTool('ShaderCompileWorker', self.getPlatformIdentifier(), 'Development', [], capture=suppressOutput)

# Generate the arguments to pass to UBT
target = self.getDescriptorName(descriptor) + target if self.isProject(descriptor) else 'UE4Editor'
baseArgs = ['-{}='.format(descriptorType) + descriptor]
Expand Down
2 changes: 1 addition & 1 deletion ue4cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

'build': {
'description': 'Build the Editor modules for the Unreal project or plugin',
'action': lambda m, args: m.buildDescriptor(os.getcwd(), args.pop(0) if len(args) > 0 else 'Development', args.pop(0) if len(args) > 0 else 'Editor', args),
'action': lambda m, args: m.buildDescriptor(os.getcwd(), args.pop(0) if (len(args) > 0 and args[0].startswith('-') == False) else 'Development', args.pop(0) if (len(args) > 0 and args[0].startswith('-') == False) else 'Editor', args),
'args': '[CONFIGURATION] [TARGET]'
},

Expand Down

0 comments on commit 259d03c

Please sign in to comment.