General improvements

This commit is contained in:
2025-10-28 16:09:14 +02:00
parent 287102dcea
commit b2e1c14618
17 changed files with 242 additions and 19 deletions

View File

@@ -1,16 +1,17 @@
#include "tier0/platform.h"
#include "tier1/commandline.h"
#include "tier1/interface.h"
#include "tier1/utlvector.h"
#include "tier2/ifilesystem.h"
#include "tier2/fileformats/ini.h"
#include "public/c.h"
#include "public/helper.h"
#include "public/ld.h"
#include "public/target.h"
#include "runner.h"
#include "tier0/platform.h"
#include "tier1/commandline.h"
#include "c.h"
#include "tier1/interface.h"
#include "tier1/utlvector.h"
#include "signal.h"
#include "libgen.h"
#include <unistd.h>
CUtlString owndir;
extern char *g_szBuildDir;
@@ -18,10 +19,6 @@ int build()
{
runner = (IRunner*)CreateInterface(RUNNER_INTERFACE_NAME, NULL);
filesystem2 = (IFileSystem2*)CreateInterface(FILE_SYSTEM_2_INTERFACE_NAME, NULL);
ccompiler = (ICCompiler*)CreateInterface(CLANG_C_COMPILER_INTERFACE_NAME, NULL);
linker = (ILinker*)CreateInterface(CLANG_LINKER_INTERFACE_NAME, NULL);
CProject_t compileScriptProject = {};
compileScriptProject.m_szName = "build";
@@ -36,6 +33,7 @@ int build()
CUtlString script = linker->Link(&linkScriptProject);
void *scriptDLL = Plat_LoadLibrary(script);
auto PreinitFn = (void(*)())Plat_GetProc(scriptDLL, "Preinit");
@@ -52,6 +50,8 @@ int build()
return 0;
};
void IEngine_Signal(int sig)
{
switch (sig)
@@ -104,6 +104,15 @@ findbuild:
signal(SIGSEGV, IEngine_Signal);
signal(SIGTERM, IEngine_Signal);
#endif
runner = (IRunner*)CreateInterface(RUNNER_INTERFACE_NAME, NULL);
filesystem2 = (IFileSystem2*)CreateInterface(FILE_SYSTEM_2_INTERFACE_NAME, NULL);
ccompiler = (ICCompiler*)CreateInterface(CLANG_C_COMPILER_INTERFACE_NAME, NULL);
linker = (ILinker*)CreateInterface(CLANG_LINKER_INTERFACE_NAME, NULL);
filesystem->Init();
g_pConfig = INIManager()->ReadFile(".fpccfg");
CommandLine()->CreateCommandLine(c, v);
if (CommandLine()->CheckParam("build"))
return build();