Split engine to packages NazaraUtils and NZSL (#375)
* Move code to NazaraUtils and NZSL packages
* Reorder includes
* Tests: Remove glslang and spirv-tools deps
* Tests: Remove glslang init
* Remove NazaraUtils tests and fix Vector4Test
* Fix Linux compilation
* Update msys2-build.yml
* Fix assimp package
* Update xmake.lua
* Update xmake.lua
* Fix shader compilation on MinGW
* Final fixes
* The final fix 2: the fix strikes back!
* Disable cache on CI
* The return of the fix™️
This commit is contained in:
27
xmake/actions/compile_shaders.lua
Normal file
27
xmake/actions/compile_shaders.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
task("compile-shaders")
|
||||
|
||||
set_menu({
|
||||
-- Settings menu usage
|
||||
usage = "xmake compile-shaders [options]",
|
||||
description = "Compile engine shaders"
|
||||
})
|
||||
|
||||
on_run(function ()
|
||||
import("core.project.project")
|
||||
local nzsl = path.join(project.required_package("nzsl"):installdir(), "bin", "nzslc")
|
||||
|
||||
local envs
|
||||
if is_plat("mingw") then
|
||||
local mingw = toolchain.load("mingw")
|
||||
if mingw and mingw:check() then
|
||||
envs = mingw:runenvs()
|
||||
end
|
||||
end
|
||||
|
||||
print("Compiling shaders...")
|
||||
for _, filepath in pairs(os.files("src/Nazara/*/Resources/**.nzsl")) do
|
||||
print(" - Compiling " .. filepath)
|
||||
local argv = {"--compile=nzslb", "--partial", "--header-file", filepath }
|
||||
os.execv(nzsl, argv, { envs = envs })
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user