xmake: Improve scripts
This commit is contained in:
parent
511a45cf6a
commit
3a58ed9701
|
|
@ -1,5 +1,4 @@
|
|||
task("compile-shaders")
|
||||
|
||||
set_menu({
|
||||
-- Settings menu usage
|
||||
usage = "xmake compile-shaders [options]",
|
||||
|
|
@ -17,13 +16,16 @@ task("compile-shaders")
|
|||
|
||||
task.run("config", {}, {disable_dump = true})
|
||||
|
||||
local nzsl = path.join(project.required_package("nzsl"):installdir(), "bin", "nzslc")
|
||||
local nzsl = project.required_package("nzsl")
|
||||
local nzslc = path.join(project.required_package("nzsl"):installdir(), "bin", "nzslc")
|
||||
|
||||
local envs
|
||||
local envs = nzsl:get("envs")
|
||||
if is_plat("mingw") then
|
||||
local mingw = toolchain.load("mingw")
|
||||
if mingw and mingw:check() then
|
||||
envs = mingw:runenvs()
|
||||
for name, value in pairs(mingw:runenvs()) do
|
||||
envs[name] = table.join(envs[name] or {}, table.wrap(value))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -38,6 +40,6 @@ task("compile-shaders")
|
|||
table.insert(argv, "--benchmark-iteration=" .. option.get("benchmark-iteration"))
|
||||
end
|
||||
table.insert(argv, filepath)
|
||||
os.vrunv(nzsl, argv, { envs = envs })
|
||||
os.vrunv(nzslc, argv, { envs = envs })
|
||||
end
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ task("create-class")
|
|||
set_menu({
|
||||
-- Settings menu usage
|
||||
usage = "xmake create-class [options] name",
|
||||
description = "Check every file for consistency (can fix some errors)",
|
||||
description = "Helper for class creation",
|
||||
options =
|
||||
{
|
||||
-- Set k mode as key-only bool parameter
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@
|
|||
rule("embed.resources")
|
||||
before_build(function (target, opt)
|
||||
import("core.base.option")
|
||||
if xmake.version():ge("2.5.9") then
|
||||
import("utils.progress")
|
||||
elseif not import("utils.progress", { try = true }) then
|
||||
import("private.utils.progress")
|
||||
end
|
||||
|
||||
local function GenerateEmbedHeader(filepath, targetpath)
|
||||
local bufferSize = 1024 * 1024
|
||||
|
|
|
|||
Loading…
Reference in New Issue