61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
#include "helper.h"
|
|
#include "c.h"
|
|
#include "ld.h"
|
|
#include "tier1/utlstring.h"
|
|
#include "tier1/commandline.h"
|
|
|
|
CUtlVector<CUtlString> engine_CompiledFiles = {
|
|
"engine/engine.cpp",
|
|
"engine/cvar.cpp",
|
|
"engine/filesystem_pak.cpp",
|
|
|
|
"engine/gamewindow_sdl.cpp",
|
|
|
|
"engine/sv_dll.cpp",
|
|
"engine/cl_dll.cpp",
|
|
};
|
|
|
|
CUtlVector<CUtlString> engine_Libraries = {
|
|
"c",
|
|
"SDL3",
|
|
};
|
|
|
|
DECLARE_BUILD_STAGE(engine)
|
|
{
|
|
CProject_t compileProject = {};
|
|
LinkProject_t ldProject = {};
|
|
|
|
compileProject.m_szName = "engine";
|
|
compileProject.files = engine_CompiledFiles;
|
|
compileProject.includeDirectories = all_IncludeDirectories;
|
|
compileProject.bFPIC = true;
|
|
ldProject = ccompiler->Compile(&compileProject);
|
|
|
|
if (bStaticBuild)
|
|
ldProject.linkType = ELINK_STATIC_LIBRARY;
|
|
else
|
|
{
|
|
ldProject.objects.AppendTail((Object_t){tier1_lib});
|
|
ldProject.objects.AppendTail((Object_t){tier2_lib});
|
|
ldProject.objects.AppendTail((Object_t){rapier_lib});
|
|
ldProject.objects.AppendTail((Object_t){material_lib});
|
|
if (bSteam)
|
|
ldProject.objects.AppendTail((Object_t){steam_lib});
|
|
ldProject.linkType = ELINK_DYNAMIC_LIBRARY;
|
|
}
|
|
|
|
|
|
ldProject.libraries = engine_Libraries;
|
|
CUtlString outputProject = linker->Link(&ldProject);
|
|
|
|
if (!bStaticBuild)
|
|
{
|
|
filesystem2->MakeDirectory(CUtlString("%s/bin",szOutputDir.GetString()));
|
|
filesystem2->CopyFile(CUtlString("%s/bin", szOutputDir.GetString()), outputProject);
|
|
} else {
|
|
engine_lib = outputProject;
|
|
}
|
|
|
|
return 0;
|
|
};
|