almost done
This commit is contained in:
21
fpc/main.cpp
21
fpc/main.cpp
@@ -13,6 +13,7 @@
|
||||
#include "c.h"
|
||||
#include "signal.h"
|
||||
#include "libgen.h"
|
||||
#include "builder.h"
|
||||
|
||||
CUtlString owndir;
|
||||
extern char *g_szBuildDir;
|
||||
@@ -24,14 +25,9 @@ void build_tier0()
|
||||
|
||||
int build()
|
||||
{
|
||||
CreateInterfaceFn pBuildFactory;
|
||||
BuildFileInfo_t *pBuildFileInfo;
|
||||
CProject_t compileScriptProject = {};
|
||||
compileScriptProject.m_szName = "build";
|
||||
compileScriptProject.files = {"build.cpp"};
|
||||
compileScriptProject.includeDirectories = {CUtlString("%s/public",filesystem2->OwnDirectory()),CUtlString("%s/public", filesystem2->BuildDirectory()), CUtlString("%s/../public",filesystem2->OwnDirectory()),CUtlString("%s/../public", filesystem2->BuildDirectory())};
|
||||
compileScriptProject.bFPIC = true;
|
||||
compileScriptProject.m_target = Target_t::HostTarget();
|
||||
BuildFile_t *pBuildFile = ProjectBuilder()->BuildProject("main",CUtlString("%s/build.cpp",g_szBuildDir));
|
||||
|
||||
/*
|
||||
|
||||
LinkProject_t linkScriptProject = ccompiler->Compile(&compileScriptProject);
|
||||
linkScriptProject.linkType = ELINK_DYNAMIC_LIBRARY;
|
||||
@@ -57,7 +53,7 @@ int build()
|
||||
{
|
||||
build->m_pMainFn();
|
||||
};
|
||||
Plat_UnloadLibrary(scriptDLL);
|
||||
*/
|
||||
|
||||
ccompiler->GenerateLinterData();
|
||||
|
||||
@@ -86,11 +82,13 @@ void IEngine_Signal(int sig)
|
||||
|
||||
int main(int c, char **v)
|
||||
{
|
||||
|
||||
char path[1024];
|
||||
|
||||
CUtlString buildcppDir = getcwd(path, 1024);
|
||||
owndir = buildcppDir;
|
||||
char *szBuildcppDir = buildcppDir.GetString();
|
||||
|
||||
findbuild:
|
||||
FILE* file = V_fopen("build.cpp", "rb");
|
||||
if (!file)
|
||||
@@ -126,6 +124,11 @@ findbuild:
|
||||
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()));
|
||||
CreateInterfaceFn pFilesystemFactory = Sys_GetFactory(pFilesystem);
|
||||
|
||||
filesystem = (IFileSystem*)CreateInterface(FILESYSTEM_INTERFACE_VERSION, NULL);
|
||||
filesystem->Init();
|
||||
|
||||
g_pConfig = INIManager()->ReadFile(".fpccfg");
|
||||
|
||||
Reference in New Issue
Block a user