Shader copying now is a pre-build step

This commit is contained in:
Nigel Barink 2022-06-08 21:40:49 +02:00
parent 16b61986a1
commit 82e0f473fb

View File

@ -32,14 +32,6 @@ project "BarinkEngine"
"../libs/ImGui"
}
links {
"phonon",
"lua54",
"spdlog",
"assimp-vc143-mtd",
"glfw3"
}
files {
"../libs/ImGui/*.cpp",
"../libs/ImGui/backends/imgui_impl_glfw.cpp",
@ -53,17 +45,29 @@ project "BarinkEngine"
}
filter { "system:windows"}
prebuildcommands {
-- Copy shaders
"copy graphics\\shaders\\fragment.shader ..\\build\\SandboxApplication\\Debug\\test.fs",
"copy graphics\\shaders\\vertex.shader ..\\build\\SandboxApplication\\Debug\\test.vs",
"copy graphics\\shaders\\RenderSurfaceFrag.shader ..\\build\\SandboxApplication\\Debug\\RenderSurface.fs",
"copy graphics\\shaders\\RenderSurfaceVert.shader ..\\build\\SandboxApplication\\Debug\\RenderSurface.vs"
}
-- NOTE: make these copy instructions more flexible
ok, err = os.copyfile("graphics/shaders/fragment.shader", "../build/SandboxApplication/Debug/test.fs")
if err then error("Copy fragment shader source failed!") end
ok, err = os.copyfile("graphics/shaders/vertex.shader", "../build/SandboxApplication/Debug/test.vs")
if err then error("Copy vertex shader source failed!") end
ok, err = os.copyfile("graphics/shaders/RenderSurfaceFrag.shader", "../build/SandboxApplication/Debug/RenderSurface.fs")
if err then error("Copy fragment shader source failed!") end
ok, err = os.copyfile("graphics/shaders/RenderSurfaceVert.shader", "../build/SandboxApplication/Debug/RenderSurface.vs")
if err then error("Copy vertex shader source failed!") end
links {
-- This needs to fall under the filter as the names can differ on different platforms
"phonon",
"lua54",
"spdlog",
"assimp-vc143-mtd",
"glfw3"
}
filter { "system:linux" }
prebuildcommands {
-- Copy shaders
"cp graphics/shaders/fragment.shader ../build/SandboxApplication/Debug/test.fs",
"cp graphics/shaders/vertex.shader ../build/SandboxApplication/Debug/test.vs",
"cp graphics/shaders/RenderSurfaceFrag.shader ../build/SandboxApplication/Debug/RenderSurface.fs",
"cp graphics/shaders/RenderSurfaceVert.shader ../build/SandboxApplication/Debug/RenderSurface.vs"
}