Started work on build system
This commit is contained in:
35
fpc/main.cpp
35
fpc/main.cpp
@@ -0,0 +1,35 @@
|
||||
#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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user