36 lines
857 B
C++
36 lines
857 B
C++
#include "public/helper.h"
|
|
#include "public/ld.h"
|
|
#include "tier0/platform.h"
|
|
#include "tier1/commandline.h"
|
|
#include "c.h"
|
|
#include "tier1/utlvector.h"
|
|
|
|
int build()
|
|
{
|
|
CCProject compileScriptProject = {};
|
|
compileScriptProject.m_szName = "build";
|
|
compileScriptProject.files = {"build.cpp"};
|
|
compileScriptProject.includeDirectories = {"public","../public"};
|
|
compileScriptProject.bFPIC = true;
|
|
CLDProject linkScriptProject = compileScriptProject.Compile();
|
|
linkScriptProject.linkType = ELINK_DYNAMIC_LIBRARY;
|
|
CUtlString script = linkScriptProject.Link();
|
|
void *scriptDLL = Plat_LoadLibrary(script);
|
|
for (auto &build: BuildStages())
|
|
{
|
|
build->m_pMainFn();
|
|
};
|
|
Plat_UnloadLibrary(scriptDLL);
|
|
|
|
return 0;
|
|
};
|
|
|
|
|
|
int main(int c, char **v)
|
|
{
|
|
ICommandLine::CreateCommandLine(c, v);
|
|
if (ICommandLine::CheckParam("build"))
|
|
return build();
|
|
return 0;
|
|
};
|