improved physics, added better caching

This commit is contained in:
2025-06-05 22:02:53 +03:00
parent 5d85ebd85f
commit 64c0f41884
36 changed files with 651 additions and 106 deletions

View File

@@ -1,4 +1,5 @@
#include "ld.h"
#include "helper.h"
#include "libgen.h"
CUtlString CLDProject::Link( void )
@@ -23,7 +24,20 @@ CUtlString CLDProject::Link( void )
IFileSystem2::MakeDirectory(szOutputDir);
if (linkType == ELINK_STATIC_LIBRARY)
{
CUtlVector<CUtlString> args = {
V_printf(" AR %s\n", m_szName.GetString());
bool shouldRecompile = false;
CUtlVector<CUtlString> args;
for (auto object: objects)
{
if (IFileSystem2::ShouldRecompile(object.m_szObjectFile,szOutputFile))
{
shouldRecompile = true;
break;
}
}
if (!shouldRecompile)
goto compiled;
args = {
"rcs",
szOutputFile
};
@@ -31,7 +45,20 @@ CUtlString CLDProject::Link( void )
args.AppendTail(object.m_szObjectFile);
IRunner::Run("ar", args);
} else {
CUtlVector<CUtlString> args = {
V_printf(" LINK %s\n", m_szName.GetString());
bool shouldRecompile = false;
CUtlVector<CUtlString> args;
for (auto object: objects)
{
if (IFileSystem2::ShouldRecompile(object.m_szObjectFile,szOutputFile))
{
shouldRecompile = true;
break;
}
}
if (!shouldRecompile)
goto compiled;
args = {
"-rdynamic",
"-o",
szOutputFile,
@@ -47,5 +74,6 @@ CUtlString CLDProject::Link( void )
}
IRunner::Run("clang++", args);
}
compiled:
return szOutputFile;
};