no engine anymore
This commit is contained in:
39
fpc/public/apktool.h
Normal file
39
fpc/public/apktool.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef APK_TOOL_H
|
||||
#define APK_TOOL_H
|
||||
|
||||
#include "tier0/platform.h"
|
||||
#include "tier1/utlstring.h"
|
||||
|
||||
struct AndroidManifest_t
|
||||
{
|
||||
public:
|
||||
void SetPackageVersion( CUtlString szVersion );
|
||||
void SetPackageBuild( uint64_t nBuild );
|
||||
void SetPackageID( CUtlString szPackageID );
|
||||
void SetPackageName( CUtlString szPackageName );
|
||||
|
||||
void SetTargetSDKVersion( uint64_t nTargetVersion );
|
||||
void SetMinSDKVersion( uint64_t nMinVersion );
|
||||
|
||||
void AddUserFeature( CUtlString szName, bool bIsRequired, uint64_t nVersion );
|
||||
void AddUserLibrary( CUtlString szPath );
|
||||
CUtlString BuildManifest();
|
||||
|
||||
CUtlString m_szPackageName;
|
||||
CUtlString m_szPackageID;
|
||||
uint64_t m_nBuild;
|
||||
CUtlString m_szVersion;
|
||||
|
||||
uint64_t m_nTargetVersion;
|
||||
uint64_t m_nMinVersion;
|
||||
};
|
||||
|
||||
abstract_class IAPKTool
|
||||
{
|
||||
public:
|
||||
virtual CUtlString BuildPackage( AndroidManifest_t manifest, CUtlString szManifestDir ) = 0;
|
||||
};
|
||||
|
||||
IAPKTool *APKTool();
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef C_H
|
||||
#define C_H
|
||||
|
||||
#include "tier0/platform.h"
|
||||
#include "tier1/utlstring.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "runner.h"
|
||||
@@ -35,20 +36,35 @@ enum ECPPVersion
|
||||
CPPVERSION_2C = 6,
|
||||
};
|
||||
|
||||
class CCProject : public CProject
|
||||
struct CProject_t : public CPUProject_t
|
||||
{
|
||||
public:
|
||||
CUtlVector<CUtlString> files = {};
|
||||
CUtlVector<C_Macro_t> macros = {};
|
||||
CUtlVector<CUtlString> includeDirectories = {};
|
||||
CUtlVector<CUtlString> includeFiles = {};
|
||||
CUtlVector<C_Macro_t> macros = {};
|
||||
|
||||
bool bFPIE = false;
|
||||
bool bFPIC = false;
|
||||
bool bDebug = m_target.optimization == TARGET_DEBUG;
|
||||
|
||||
ECVersion cVersion;
|
||||
ECPPVersion cppVersion;
|
||||
CLDProject Compile();
|
||||
static void GenerateCompileCommands();
|
||||
|
||||
AndroidManifest_t m_androidmanifest;
|
||||
};
|
||||
|
||||
#define C_COMPILER_INTERFACE_NAME "CCompiler001"
|
||||
#define CLANG_C_COMPILER_INTERFACE_NAME "ClangCCompiler001"
|
||||
#define GCC_C_COMPILER_INTERFACE_NAME "GCCCCompiler001"
|
||||
#define MSVC_C_COMPILER_INTERFACE_NAME "MSVCCCompiler001"
|
||||
|
||||
abstract_class ICCompiler
|
||||
{
|
||||
public:
|
||||
virtual LinkProject_t Compile( CProject_t *pProject ) = 0;
|
||||
virtual void GenerateLinterData( void ) = 0;
|
||||
};
|
||||
|
||||
extern ICCompiler *ccompiler;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,30 +1,62 @@
|
||||
#ifndef HELPER_H
|
||||
#define HELPER_H
|
||||
|
||||
#include "apktool.h"
|
||||
#include "tier1/utlstring.h"
|
||||
#include "target.h"
|
||||
|
||||
#define FPC_TEMPORAL_DIRNAME ".fpc"
|
||||
|
||||
class CProject
|
||||
|
||||
struct BaseProject_t
|
||||
{
|
||||
public:
|
||||
Target_t m_target = Target_t::DefaultTarget();
|
||||
CUtlString m_szName;
|
||||
unsigned int GenerateProjectHash( void );
|
||||
};
|
||||
|
||||
interface IFileSystem2
|
||||
|
||||
struct CPUProject_t : public BaseProject_t
|
||||
{
|
||||
public:
|
||||
static char *OwnDirectory();
|
||||
static char *BuildDirectory();
|
||||
static void MakeDirectory( const char *psz );
|
||||
static void CopyFile( const char *szDestination, const char *szOrigin );
|
||||
static void CopyDirectory( const char *szDestination, const char *szOrigin );
|
||||
static bool ShouldRecompile( const char *szSource, const char *szOutput );
|
||||
Target_t m_target = Target_t::DefaultTarget();
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct ShaderProject_t : public BaseProject_t
|
||||
{
|
||||
public:
|
||||
EShaderTarget m_eTarget;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// File system.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define FILE_SYSTEM_2_INTERFACE_NAME "FileSystem2_001"
|
||||
|
||||
abstract_class IFileSystem2
|
||||
{
|
||||
public:
|
||||
// Returns a directory of fpc executable
|
||||
virtual char *OwnDirectory() = 0;
|
||||
|
||||
// Returns directory of build.cpp
|
||||
virtual char *BuildDirectory() = 0;
|
||||
|
||||
virtual void MakeDirectory( const char *psz ) = 0;
|
||||
virtual void CopyFile( const char *szDestination, const char *szOrigin ) = 0;
|
||||
virtual void CopyDirectory( const char *szDestination, const char *szOrigin ) = 0;
|
||||
virtual bool ShouldRecompile( const char *szSource, const char *szOutput ) = 0;
|
||||
};
|
||||
|
||||
extern IFileSystem2 *filesystem2;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Build stage.
|
||||
//-----------------------------------------------------------------------------
|
||||
class CBuildStage
|
||||
{
|
||||
public:
|
||||
@@ -33,8 +65,10 @@ public:
|
||||
int(*m_pMainFn)();
|
||||
};
|
||||
|
||||
#define DECLARE_BUILD_STAGE(sz, fn) \
|
||||
CBuildStage __##sz##_build_stage(#sz, fn);
|
||||
#define DECLARE_BUILD_STAGE(sz) \
|
||||
int __build_stage_##sz(); \
|
||||
CBuildStage __##sz##_build_stage(#sz, __build_stage_##sz); \
|
||||
int __build_stage_##sz()
|
||||
|
||||
CUtlVector<CBuildStage*>& BuildStages();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "runner.h"
|
||||
#include "helper.h"
|
||||
#include "obj.h"
|
||||
#include "tier0/platform.h"
|
||||
#include "tier1/utlstring.h"
|
||||
|
||||
enum ELinkType
|
||||
@@ -14,22 +15,32 @@ enum ELinkType
|
||||
ELINK_STATIC_LIBRARY,
|
||||
};
|
||||
|
||||
class CLDProject: public CProject
|
||||
struct LinkProject_t: public CPUProject_t
|
||||
{
|
||||
public:
|
||||
void AddObject( CObject& object );
|
||||
void AddLibrary( CUtlString psz );
|
||||
void AddLibraryByPath( CUtlString szPath );
|
||||
void AddLibraryDirectory( CUtlString szPath );
|
||||
CUtlString Link( void );
|
||||
void AddObject( Object_t& object );
|
||||
|
||||
ELinkType linkType;
|
||||
CUtlVector<CObject> objects = {};
|
||||
CUtlVector<Object_t> objects = {};
|
||||
CUtlVector<CUtlString> libraries ={};
|
||||
CUtlVector<CUtlString> libraryDirectories = {};
|
||||
CUtlVector<CUtlString> libraryObjects = {};
|
||||
CUtlVector<CUtlString> frameworkDirectories = {};
|
||||
CUtlVector<CUtlString> frameworks = {};
|
||||
AndroidManifest_t m_androidmanifest;
|
||||
|
||||
bool bNoStdLib;
|
||||
};
|
||||
|
||||
#define LINKER_INTERFACE_NAME "Linker001"
|
||||
#define CLANG_LINKER_INTERFACE_NAME "ClangLinker001"
|
||||
|
||||
abstract_class ILinker
|
||||
{
|
||||
public:
|
||||
virtual CUtlString Link( LinkProject_t *pProject ) = 0;
|
||||
};
|
||||
|
||||
extern ILinker *linker;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "tier1/utlstring.h"
|
||||
|
||||
class CObject
|
||||
struct Object_t
|
||||
{
|
||||
public:
|
||||
CUtlString m_szObjectFile;
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
#ifndef RUNNER_H
|
||||
#define RUNNER_H
|
||||
|
||||
#include "tier0/platform.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "tier1/utlstring.h"
|
||||
|
||||
interface IRunner
|
||||
#define RUNNER_INTERFACE_NAME "Runner001"
|
||||
|
||||
abstract_class IRunner
|
||||
{
|
||||
public:
|
||||
static int Run( CUtlString szName, CUtlVector<CUtlString>& args );
|
||||
static int Run( CUtlString szName, CUtlString szDirectory, CUtlVector<CUtlString>& args );
|
||||
static int Run( CUtlString szName, CUtlString szDirectory, CUtlVector<CUtlString>& args, CUtlVector<CUtlString>& environment );
|
||||
static int Wait( void );
|
||||
virtual int Run( CUtlString szName, CUtlVector<CUtlString>& args ) = 0;
|
||||
virtual int Run( CUtlString szName, CUtlString szDirectory, CUtlVector<CUtlString>& args ) = 0;
|
||||
virtual int Run( CUtlString szName, CUtlString szDirectory, CUtlVector<CUtlString>& args, CUtlVector<CUtlString>& environment ) = 0;
|
||||
virtual int Wait( void ) = 0;
|
||||
};
|
||||
|
||||
extern IRunner *runner;
|
||||
|
||||
#endif
|
||||
|
||||
21
fpc/public/signtool.h
Normal file
21
fpc/public/signtool.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef SIGN_TOOL_H
|
||||
#define SIGN_TOOL_H
|
||||
|
||||
#include "tier0/platform.h"
|
||||
#include "tier1/utlstring.h"
|
||||
|
||||
#define APPLE_SIGN_TOOL_INTERFACE_NAME "SignToolApple001"
|
||||
#define ANDROID_SIGN_TOOL_INTERFACE_NAME "SignToolAndroid001"
|
||||
|
||||
abstract_class ISignTool
|
||||
{
|
||||
public:
|
||||
virtual void SetSignPassword( CUtlString szPassword ) = 0;
|
||||
virtual void SignFile( CUtlString szFile ) = 0;
|
||||
virtual void SignDirectory( CUtlString szDirectory ) = 0;
|
||||
};
|
||||
|
||||
extern ISignTool *signtool_android;
|
||||
extern ISignTool *signtool_apple;
|
||||
|
||||
#endif
|
||||
0
fpc/public/slang.h
Normal file
0
fpc/public/slang.h
Normal file
@@ -2,20 +2,30 @@
|
||||
#define TARGET_T
|
||||
|
||||
#include "tier1/utlstring.h"
|
||||
#include "tier1/commandline.h"
|
||||
|
||||
enum ETargetKernel
|
||||
{
|
||||
TARGET_KERNEL_UNKNOWN,
|
||||
TARGET_KERNEL_LINUX,
|
||||
TARGET_KERNEL_WINDOWS,
|
||||
TARGET_KERNEL_DARWIN,
|
||||
TARGET_KERNEL_IOS,
|
||||
TARGET_KERNEL_ANDROID,
|
||||
TARGET_KERNEL_WASI,
|
||||
TARGET_KERNEL_EMSCRIPTEN,
|
||||
};
|
||||
|
||||
enum ETargetCPU
|
||||
{
|
||||
TARGET_CPU_AMD64,
|
||||
TARGET_CPU_I286,
|
||||
TARGET_CPU_I386,
|
||||
TARGET_CPU_I486,
|
||||
TARGET_CPU_I586,
|
||||
TARGET_CPU_I686,
|
||||
TARGET_CPU_AARCH64,
|
||||
TARGET_CPU_WASM32,
|
||||
};
|
||||
|
||||
enum ETargetOptimization
|
||||
@@ -30,9 +40,21 @@ struct Target_t
|
||||
ETargetKernel kernel;
|
||||
ETargetCPU cpu;
|
||||
ETargetOptimization optimization;
|
||||
const char *szSysroot = CommandLine()->ParamValue("-sysroot");
|
||||
|
||||
CUtlString GetTriplet();
|
||||
static Target_t HostTarget();
|
||||
static Target_t DefaultTarget();
|
||||
};
|
||||
|
||||
enum EShaderTarget
|
||||
{
|
||||
SHADER_TARGET_VULKAN_SPIRV,
|
||||
SHADER_TARGET_OPENGL_SPIRV,
|
||||
SHADER_TARGET_GLSL,
|
||||
SHADER_TARGET_HLSL,
|
||||
SHADER_TARGET_MSL,
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
0
fpc/public/windres.h
Normal file
0
fpc/public/windres.h
Normal file
Reference in New Issue
Block a user