some work on fpc

This commit is contained in:
2025-12-30 22:13:01 +02:00
parent 842eeabbde
commit 773a541199
27 changed files with 298 additions and 101 deletions

View File

@@ -16,7 +16,7 @@
#include "builder.h"
CUtlString owndir;
extern char *g_szBuildDir;
static char **pszBuildDir;
void build_tier0()
{
@@ -25,7 +25,7 @@ void build_tier0()
int build()
{
BuildFile_t *pBuildFile = ProjectBuilder()->BuildProject("main",CUtlString("%s/build.cpp",g_szBuildDir));
BuildFile_t *pBuildFile = ProjectBuilder()->BuildProject("main",CUtlString("%s/build.cpp",*pszBuildDir));
/*
@@ -80,6 +80,12 @@ void IEngine_Signal(int sig)
Plat_Exit(0);
};
IRunner *runner;
IWineRunner *winerunner;
ICCompiler *ccompiler;
ILinker *linker;
int main(int c, char **v)
{
@@ -104,7 +110,6 @@ findbuild:
} else {
V_fclose(file);
}
g_szBuildDir = szBuildcppDir;
#ifdef __linux
signal(SIGHUP, IEngine_Signal);
@@ -118,17 +123,28 @@ findbuild:
signal(SIGSEGV, IEngine_Signal);
signal(SIGTERM, IEngine_Signal);
#endif
runner = (IRunner*)CreateInterface(RUNNER_INTERFACE_NAME, NULL);
winerunner = (IWineRunner*)CreateInterface(WINE_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);
void *pFilesystem = Plat_LoadLibrary(CUtlString("%s/libfilesystem_std.so",filesystem2->OwnDirectory()));
void *pLibFPC = Plat_LoadLibrary("libfpc.so");
CreateInterfaceFn pLibFPCFactory = Sys_GetFactory(pLibFPC);
filesystem2 = (IFileSystem2*)pLibFPCFactory(FILE_SYSTEM_2_INTERFACE_NAME, NULL);
pszBuildDir = (char**)pLibFPCFactory(FILE_SYSTEM_2_BUILD_DIRECTORY_INTERFACE_VERSION, NULL);
*pszBuildDir = szBuildcppDir;
runner = (IRunner*)pLibFPCFactory(RUNNER_INTERFACE_NAME, NULL);
winerunner = (IWineRunner*)pLibFPCFactory(WINE_RUNNER_INTERFACE_NAME, NULL);
ccompiler = (ICCompiler*)pLibFPCFactory(CLANG_C_COMPILER_INTERFACE_NAME, NULL);
linker = (ILinker*)pLibFPCFactory(CLANG_LINKER_INTERFACE_NAME, NULL);
pLibFPCFactory(LIBFPC_INIT_INTERFACE_VERSION, NULL);
void *pFilesystem = Plat_LoadLibrary("libfilesystem_std.so");
CreateInterfaceFn pFilesystemFactory = Sys_GetFactory(pFilesystem);
filesystem = (IFileSystem*)CreateInterface(FILESYSTEM_INTERFACE_VERSION, NULL);
filesystem = (IFileSystem*)pFilesystemFactory(FILESYSTEM_INTERFACE_VERSION, NULL);
filesystem->Init();
g_pConfig = INIManager()->ReadFile(".fpccfg");