Crafter.Build/tests/ShaderDep/inner/project.cpp

37 lines
1.4 KiB
C++
Raw Normal View History

2026-05-01 19:16:13 +02:00
import std;
import Crafter.Build;
namespace fs = std::filesystem;
using namespace Crafter;
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view>) {
static auto ShaderLib = std::make_unique<Configuration>();
ShaderLib->path = "./lib/";
ShaderLib->name = "ShaderLib";
ShaderLib->outputName = "ShaderLib";
ShaderLib->target = "x86_64-pc-linux-gnu";
ShaderLib->type = ConfigurationType::LibraryStatic;
{
std::array<fs::path, 1> ifaces = { "ShaderLib" };
std::array<fs::path, 0> impls = {};
ShaderLib->GetInterfacesAndImplementations(ifaces, impls);
}
ShaderLib->shaders.emplace_back("./lib/triangle.glsl", "main", ShaderType::Vertex);
2026-05-02 21:08:51 +02:00
ShaderLib->files.emplace_back("./lib/asset.txt");
ShaderLib->files.emplace_back("./lib/data");
ShaderLib->buildFiles.emplace_back("./lib/ui-shared.glsl");
2026-05-01 19:16:13 +02:00
Configuration app;
app.path = "./";
app.name = "shader-dep-app";
app.outputName = "shader-dep-app";
app.target = "x86_64-pc-linux-gnu";
app.type = ConfigurationType::Executable;
app.dependencies = { ShaderLib.get() };
{
std::array<fs::path, 0> ifaces = {};
std::array<fs::path, 1> impls = { "main" };
app.GetInterfacesAndImplementations(ifaces, impls);
}
2026-05-02 21:08:51 +02:00
app.shaders.emplace_back("./consumer.glsl", "main", ShaderType::Vertex);
2026-05-01 19:16:13 +02:00
return app;
}