This commit is contained in:
parent
df9436c51d
commit
de9865b583
8 changed files with 163 additions and 1 deletions
3
tests/ShaderDep/inner/lib/ShaderLib.cppm
Normal file
3
tests/ShaderDep/inner/lib/ShaderLib.cppm
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export module ShaderLib;
|
||||
|
||||
export int Identify() { return 0; }
|
||||
13
tests/ShaderDep/inner/lib/triangle.glsl
Normal file
13
tests/ShaderDep/inner/lib/triangle.glsl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#version 450
|
||||
|
||||
layout(location = 0) out vec3 color;
|
||||
|
||||
void main() {
|
||||
vec2 positions[3] = vec2[](
|
||||
vec2( 0.0, -0.5),
|
||||
vec2( 0.5, 0.5),
|
||||
vec2(-0.5, 0.5)
|
||||
);
|
||||
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
|
||||
color = vec3(1.0, 0.0, 0.0);
|
||||
}
|
||||
4
tests/ShaderDep/inner/main.cpp
Normal file
4
tests/ShaderDep/inner/main.cpp
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import std;
|
||||
import ShaderLib;
|
||||
|
||||
int main() { return Identify(); }
|
||||
33
tests/ShaderDep/inner/project.cpp
Normal file
33
tests/ShaderDep/inner/project.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
return app;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue