70 lines
1.8 KiB
C++
70 lines
1.8 KiB
C++
#include "helper.h"
|
|
#include "c.h"
|
|
#include "ld.h"
|
|
#include "tier1/utlstring.h"
|
|
#include "tier1/commandline.h"
|
|
|
|
CUtlVector<CUtlString> MaterialSystem_CompiledFiles = {
|
|
"materialsystem.cpp",
|
|
"compiledshader.cpp",
|
|
};
|
|
CUtlVector<CUtlString> RenderContextVulkan_CompiledFiles = {
|
|
"vulkan/shaderparser.cpp",
|
|
"vulkan/rendercontext.cpp",
|
|
"vulkan/commandbuffer.cpp",
|
|
"vulkan/rendercommandlist.cpp",
|
|
"vulkan/material.cpp",
|
|
"vulkan/shader.cpp",
|
|
"vulkan/utils.cpp",
|
|
"vulkan/vma.cpp",
|
|
"vulkan/commands/draw.cpp",
|
|
"vulkan/commands/transfer.cpp",
|
|
"vulkan/commands/base.cpp",
|
|
"vulkan/libraries/raster.cpp",
|
|
"../external/volk/volk.c",
|
|
};
|
|
CUtlString material_lib;
|
|
|
|
DECLARE_BUILD_STAGE(MaterialSystem)
|
|
{
|
|
CProject_t compileProject = {};
|
|
LinkProject_t ldProject = {};
|
|
|
|
compileProject.m_szName = "MaterialSystem";
|
|
compileProject.files = MaterialSystem_CompiledFiles;
|
|
compileProject.includeDirectories = { "../public" };
|
|
compileProject.bFPIC = true;
|
|
ldProject = ccompiler->Compile(&compileProject);
|
|
ldProject.linkType = ELINK_DYNAMIC_LIBRARY;
|
|
|
|
CUtlString outputProject = linker->Link(&ldProject);
|
|
material_lib = outputProject;
|
|
|
|
return 0;
|
|
}
|
|
|
|
DECLARE_BUILD_STAGE(RenderSystemVulkan)
|
|
{
|
|
CProject_t compileProject = {};
|
|
LinkProject_t ldProject = {};
|
|
|
|
compileProject.m_szName = "RenderSystemVulkan";
|
|
compileProject.files = RenderContextVulkan_CompiledFiles;
|
|
compileProject.includeDirectories = {
|
|
"../public",
|
|
"../external/Vulkan-Headers/include",
|
|
"../external/Vulkan-Utility-Libraries/include",
|
|
"../external/VulkanMemoryAllocator/include",
|
|
"../external/volk"
|
|
};
|
|
compileProject.bFPIC = true;
|
|
ldProject = ccompiler->Compile(&compileProject);
|
|
ldProject.linkType = ELINK_DYNAMIC_LIBRARY;
|
|
ldProject.libraries = { "vulkan" };
|
|
|
|
CUtlString outputProject = linker->Link(&ldProject);
|
|
material_lib = outputProject;
|
|
|
|
return 0;
|
|
}
|