Started work on build system
This commit is contained in:
46
fpc/library/helper.cpp
Normal file
46
fpc/library/helper.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "helper.h"
|
||||
#include "runner.h"
|
||||
#include "tier0/platform.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "tier1/utlstring.h"
|
||||
|
||||
unsigned int g_hashState = 102851263;
|
||||
unsigned int CProject::GenerateProjectHash( void )
|
||||
{
|
||||
unsigned int hash = 5381+g_hashState;
|
||||
int c;
|
||||
char *szName = m_szName;
|
||||
|
||||
while( (c = *szName++) )
|
||||
hash = (hash * 33) + c;
|
||||
|
||||
g_hashState = g_hashState * 1664525 + 1013904223;
|
||||
|
||||
return hash;
|
||||
};
|
||||
|
||||
void IFileSystem2::MakeDirectory( const char *psz )
|
||||
{
|
||||
CUtlVector<CUtlString> args = {
|
||||
"-p",
|
||||
psz,
|
||||
};
|
||||
IRunner::Run("mkdir", args);
|
||||
};
|
||||
|
||||
CUtlVector<CBuildStage*> g_buildStages;
|
||||
|
||||
CBuildStage::CBuildStage( CUtlString sz, int(*pMainFn)() )
|
||||
{
|
||||
m_sz = sz;
|
||||
m_pMainFn = pMainFn;
|
||||
if (sz == 0 || pMainFn == 0)
|
||||
Plat_FatalErrorFunc("Name and function pointer must be set\n");
|
||||
|
||||
g_buildStages.AppendTail(this);
|
||||
};
|
||||
|
||||
CUtlVector<CBuildStage*>& BuildStages()
|
||||
{
|
||||
return g_buildStages;
|
||||
}
|
||||
Reference in New Issue
Block a user