2015-05-11 10:18:48 -04:00
|
|
|
// Copyright 1998-2015 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(""));
|
|
|
|
|
|
|
|
|
|
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 '%s'"), ArgV[1]);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-11 11:26:36 -04:00
|
|
|
return Graph.ExecuteInParallel(FPlatformMisc::NumberOfCoresIncludingHyperthreads());
|
2015-05-11 10:18:48 -04:00
|
|
|
}
|