This commit is contained in:
2025-06-04 00:18:32 +03:00
parent 804711f2c4
commit 5d85ebd85f
17 changed files with 108 additions and 7 deletions

View File

@@ -3,7 +3,6 @@
#include "helper.h"
#include "tier1/utlvector.h"
#include "libgen.h"
#include <cstdio>
struct ClangFile_t
{
@@ -21,11 +20,10 @@ CLDProject CCProject::Compile()
for (auto &file: files)
{
CUtlString szOutputFile = CUtlString("%s/cc/%u_%s/%s/%s.o",FPC_TEMPORAL_DIRNAME, hash, m_szName.GetString(), IFileSystem2::OwnDirectory(), file.GetString());
CUtlString szOutputDir = szOutputFile;
szOutputDir = dirname(szOutputDir);
IFileSystem2::MakeDirectory(szOutputDir);
CUtlString szOutputDir;
CUtlVector<CUtlString> args;
CUtlVector<CUtlString> args = {
args = {
"-g",
"-c",
"-o",
@@ -51,7 +49,14 @@ CLDProject CCProject::Compile()
args.AppendTail("-include");
args.AppendTail(include);
}
if (!IFileSystem2::ShouldRecompile(file, szOutputFile))
goto skipcompile;
szOutputDir = szOutputFile;
szOutputDir = dirname(szOutputDir);
IFileSystem2::MakeDirectory(szOutputDir);
IRunner::Run("clang", args);
skipcompile:
proj.objects.AppendTail((CObject){szOutputFile});
ClangFile_t cfile = {};