Files
UnrealEngineUWP/Engine/Source/Programs/ParallelExecutor/Private/ParallelExecutor.cpp
Matthew Griffin bb70b349ce Merging CL 2804086 from //UE4/Release-4.11 to Dev-Main (//UE4/Dev-Main) to isolate copyright update
#lockdown Nick.Penwarden

[CL 2819020 by Matthew Griffin in Main branch]
2016-01-07 08:17:16 -05:00

35 lines
886 B
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "ParallelExecutor.h"
#include "RequiredProgramMainCPPInclude.h"
#include "BuildGraph.h"
IMPLEMENT_APPLICATION(ParallelExecutor, "ParallelExecutor")
int main(int ArgC, const char* ArgV[])
{
// TODO: command line options for limiting number of processes
// TODO: add ability to modify environment for child process, and add to job
// TODO: add a FPlatformMisc::WaitForProcessOutput() with optional parameter for cancel event
FCommandLine::Set(TEXT(""));
setvbuf(stdout, NULL, _IONBF, 0);
if(ArgC != 2)
{
wprintf(TEXT("Missing argument to ParallelExecutor for build graph."));
return 1;
}
FBuildGraph Graph;
if(!Graph.ReadFromFile(ArgV[1]))
{
wprintf(TEXT("Couldn't read '%hs'"), ArgV[1]);
return 1;
}
return Graph.ExecuteInParallel(FPlatformMisc::NumberOfCoresIncludingHyperthreads());
}