no engine anymore
This commit is contained in:
@@ -6,12 +6,13 @@
|
||||
#include "unistd.h"
|
||||
#include "libgen.h"
|
||||
#include "sys/stat.h"
|
||||
#include "tier1/interface.h"
|
||||
#ifdef __APPLE__
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
unsigned int g_hashState = 102851263;
|
||||
unsigned int CProject::GenerateProjectHash( void )
|
||||
unsigned int BaseProject_t::GenerateProjectHash( void )
|
||||
{
|
||||
unsigned int hash = 5381+g_hashState;
|
||||
int c;
|
||||
@@ -31,50 +32,65 @@ static ssize_t pathSize = readlink("/proc/self/exe", path, sizeof(path) - 1);
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
static uint32_t pathSize = sizeof(path);
|
||||
int pathResult = _NSGetExecutablePath(path, &pathSize);
|
||||
static int pathResult = _NSGetExecutablePath(path, &pathSize);
|
||||
#endif
|
||||
char *szPathDir = dirname(path);
|
||||
char *szBuildDir = 0;
|
||||
char *IFileSystem2::OwnDirectory()
|
||||
static char *szPathDir = dirname(path);
|
||||
char *g_szBuildDir = 0;
|
||||
|
||||
class CPOSIXFileSystem2: public IFileSystem2
|
||||
{
|
||||
public:
|
||||
virtual char *OwnDirectory() override;
|
||||
virtual char *BuildDirectory() override;
|
||||
virtual void MakeDirectory( const char *psz ) override;
|
||||
virtual void CopyFile( const char *szDestination, const char *szOrigin ) override;
|
||||
virtual void CopyDirectory( const char *szDestination, const char *szOrigin ) override;
|
||||
virtual bool ShouldRecompile( const char *szSource, const char *szOutput ) override;
|
||||
};
|
||||
|
||||
EXPOSE_INTERFACE(CPOSIXFileSystem2, IFileSystem2, FILE_SYSTEM_2_INTERFACE_NAME);
|
||||
IFileSystem2 *filesystem2;
|
||||
|
||||
char *CPOSIXFileSystem2::OwnDirectory()
|
||||
{
|
||||
return szPathDir;
|
||||
};
|
||||
char *IFileSystem2::BuildDirectory()
|
||||
char *CPOSIXFileSystem2::BuildDirectory()
|
||||
{
|
||||
return szBuildDir;
|
||||
return g_szBuildDir;
|
||||
};
|
||||
|
||||
void IFileSystem2::CopyFile( const char *szDestination, const char *szOrigin )
|
||||
void CPOSIXFileSystem2::CopyFile( const char *szDestination, const char *szOrigin )
|
||||
{
|
||||
CUtlVector<CUtlString> args = {
|
||||
CUtlString(szOrigin),
|
||||
CUtlString(szDestination),
|
||||
};
|
||||
IRunner::Run("cp", args);
|
||||
IRunner::Wait();
|
||||
runner->Run("cp", args);
|
||||
runner->Wait();
|
||||
}
|
||||
void IFileSystem2::CopyDirectory( const char *szDestination, const char *szOrigin )
|
||||
void CPOSIXFileSystem2::CopyDirectory( const char *szDestination, const char *szOrigin )
|
||||
{
|
||||
CUtlVector<CUtlString> args = {
|
||||
"-r",
|
||||
CUtlString(szOrigin),
|
||||
CUtlString(szDestination),
|
||||
};
|
||||
IRunner::Run("cp", args);
|
||||
IRunner::Wait();
|
||||
runner->Run("cp", args);
|
||||
runner->Wait();
|
||||
}
|
||||
|
||||
void IFileSystem2::MakeDirectory( const char *psz )
|
||||
void CPOSIXFileSystem2::MakeDirectory( const char *psz )
|
||||
{
|
||||
CUtlVector<CUtlString> args = {
|
||||
"-p",
|
||||
CUtlString(psz),
|
||||
};
|
||||
IRunner::Run("mkdir", args);
|
||||
IRunner::Wait();
|
||||
runner->Run("mkdir", args);
|
||||
runner->Wait();
|
||||
};
|
||||
|
||||
bool IFileSystem2::ShouldRecompile(const char *szSource, const char *szOutput)
|
||||
bool CPOSIXFileSystem2::ShouldRecompile(const char *szSource, const char *szOutput)
|
||||
{
|
||||
struct stat srcbuf;
|
||||
struct stat outbuf;
|
||||
|
||||
Reference in New Issue
Block a user