improved physics, added better caching
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user