trying to improve the stuff

This commit is contained in:
2025-12-26 23:59:32 +02:00
parent 352b3b1fc8
commit bf5ca2c23b
9 changed files with 95 additions and 16 deletions

31
fpc/public/builder.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef BUILDER_H
#define BUILDER_H
#include "tier1/interface.h"
#include "tier1/utlvector.h"
struct BuildOutput_t
{
};
struct BuildOutputs_t
{
const char *m_szBuildStageName;
CUtlVector<BuildOutput_t> m_buildOutputs;
};
struct BuildFile_t
{
void *m_pLibrary;
CUtlVector<BuildOutputs_t> m_compiledProjects;
};
abstract_class IProjectBuilder
{
virtual BuildFile_t *BuildProject( const char *szPath ) = 0;
};
IProjectBuilder *ProjectBuilder();
#endif

View File

@@ -9,6 +9,7 @@
#include "tier1/utlstring.h"
#include "target.h"
#include "tier2/fileformats/ini.h"
#include "tier1/interface.h"
#define FPC_TEMPORAL_DIRNAME ".fpc"
@@ -81,11 +82,17 @@ extern IFileSystem2 *filesystem2;
class CBuildStage
{
public:
CBuildStage( CUtlString sz, int(*pMainFn)() );
CUtlString m_sz;
CBuildStage( const char *psz, int(*pMainFn)() );
const char *m_psz;
int(*m_pMainFn)();
};
class CBuildDependentFile
{
};
//-----------------------------------------------------------------------------
// Declares new build stage.
// example:
@@ -107,9 +114,16 @@ int __build_stage_##sz()
#define GET_PROJECT_LIBRARY(sz, szLib) \
// Returns all available build stages
// Used internally
CUtlVector<CBuildStage*>& BuildStages();
struct BuildFileInfo_t
{
CUtlVector<const char*> m_dependantFile;
CUtlVector<CBuildStage*> m_stages;
};
BuildFileInfo_t *GetBuildFileInfo();
#define BUILD_FILE_INFO_INTERFACE_NAME "BuildFileInfo001"
extern IINIFile *g_pConfig;

11
fpc/public/interfaces.cpp Normal file
View File

@@ -0,0 +1,11 @@
#include "tier1/interface.h"
#include "helper.h"
static BuildFileInfo_t buildfileinfo = {};
BuildFileInfo_t *GetBuildFileInfo()
{
return &buildfileinfo;
}
EXPOSE_INTERFACE_GLOBALVAR(BuildFileInfo_t, BuildFileInfo_t, BUILD_FILE_INFO_INTERFACE_NAME, buildfileinfo);