trying to improve the stuff
This commit is contained in:
20
fpc/main.cpp
20
fpc/main.cpp
@@ -16,11 +16,16 @@
|
||||
|
||||
CUtlString owndir;
|
||||
extern char *g_szBuildDir;
|
||||
int build()
|
||||
|
||||
void build_tier0()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
int build()
|
||||
{
|
||||
CreateInterfaceFn pBuildFactory;
|
||||
BuildFileInfo_t *pBuildFileInfo;
|
||||
CProject_t compileScriptProject = {};
|
||||
compileScriptProject.m_szName = "build";
|
||||
compileScriptProject.files = {"build.cpp"};
|
||||
@@ -36,12 +41,19 @@ int build()
|
||||
|
||||
|
||||
void *scriptDLL = Plat_LoadLibrary(script);
|
||||
pBuildFactory = Sys_GetFactory(scriptDLL);
|
||||
|
||||
|
||||
pBuildFactory = NULL;
|
||||
pBuildFileInfo = (BuildFileInfo_t*)pBuildFactory(BUILD_FILE_INFO_INTERFACE_NAME, NULL);
|
||||
if (!pBuildFactory)
|
||||
Plat_FatalErrorFunc("Failed to find build file info interface\n");
|
||||
|
||||
auto PreinitFn = (void(*)())Plat_GetProc(scriptDLL, "Preinit");
|
||||
if (PreinitFn)
|
||||
PreinitFn();
|
||||
|
||||
for (auto &build: BuildStages())
|
||||
for (auto &build: pBuildFileInfo->m_stages)
|
||||
{
|
||||
build->m_pMainFn();
|
||||
};
|
||||
@@ -61,7 +73,7 @@ void IEngine_Signal(int sig)
|
||||
case SIGILL:
|
||||
case SIGABRT:
|
||||
Plat_Backtrace();
|
||||
Plat_FatalErrorFunc("Fault");
|
||||
Plat_FatalErrorFunc("Fault\n");
|
||||
break;
|
||||
case SIGINT:
|
||||
Plat_Exit(0);
|
||||
|
||||
Reference in New Issue
Block a user