summaryrefslogtreecommitdiff
path: root/xmake/rules/utils/ispc/ispc.lua
diff options
context:
space:
mode:
authorstar-hengxing <[email protected]>2022-11-08 15:04:21 +0800
committerstar-hengxing <[email protected]>2022-11-08 15:04:21 +0800
commitfe898e2333df2ba376810d709d354d6a6166bb56 (patch)
tree8c57be74c7c3ddea877e05ee3e22342452167ab5 /xmake/rules/utils/ispc/ispc.lua
parent1d4ef9a6c6803f267cfe57adfa8315d81cc79168 (diff)
fix unknown utils.ispc
Diffstat (limited to 'xmake/rules/utils/ispc/ispc.lua')
-rw-r--r--xmake/rules/utils/ispc/ispc.lua69
1 files changed, 0 insertions, 69 deletions
diff --git a/xmake/rules/utils/ispc/ispc.lua b/xmake/rules/utils/ispc/ispc.lua
deleted file mode 100644
index b1e924c65..000000000
--- a/xmake/rules/utils/ispc/ispc.lua
+++ /dev/null
@@ -1,69 +0,0 @@
-rule("utils.ispc")
- set_extensions(".ispc")
-
- on_load(function (target)
- local headersdir = path.join(target:autogendir(), "rules", "utils", "ispc", "headers")
- os.mkdir(headersdir)
- target:add("includedirs", headersdir, {public = true})
- end)
-
- before_buildcmd_file(function (target, batchcmds, sourcefile_ispc, opt)
- import("lib.detect.find_tool")
- local ispc = assert(find_tool("ispc"), "ispc not found!")
-
- local flags = {}
- if target:values("ispc.flags") then
- table.join2(flags, target:values("ispc.flags"))
- end
-
- if target:get("symbols") == "debug" then
- table.insert(flags, "-g")
- end
-
- if target:get("optimize") == "none" then
- table.insert(flags, "-O0")
- elseif target:get("optimize") == "fast" then
- table.insert(flags, "-O2")
- elseif target:get("optimize") == "faster" or target:get("optimize") == "fastest" then
- table.insert(flags, "-O3")
- elseif target:get("optimize") == "smallest" then
- table.insert(flags, "-O1")
- end
-
- if target:get("warnings") == "none" then
- table.insert(flags, "--woff")
- elseif target:get("warnings") == "error" then
- table.insert(flags, "--werror")
- end
-
- if not target:is_plat("windows") then
- table.insert(flags, "--pic")
- end
-
- local headersdir = path.join(target:autogendir(), "rules", "utils", "ispc", "headers")
- local objectfile = target:objectfile(sourcefile_ispc)
- local objectdir = path.directory(objectfile)
- local headersfile
- local header_extension = target:extraconf("rules", "utils.ispc", "header_extension")
- if header_extension then
- headersfile = path.join(headersdir, path.basename(sourcefile_ispc) .. header_extension)
- else
- headersfile = path.join(headersdir, path.filename(sourcefile_ispc) .. ".h")
- end
-
- table.insert(flags, "-o")
- table.insert(flags, path(objectfile))
- table.insert(flags, "-h")
- table.insert(flags, path(headersfile))
- table.insert(flags, path(sourcefile_ispc))
-
- batchcmds:show_progress(opt.progress, "${color.build.object}compiling.ispc %s", sourcefile_ispc)
- batchcmds:mkdir(objectdir)
- batchcmds:vrunv(ispc.program, flags)
-
- table.insert(target:objectfiles(), objectfile)
-
- batchcmds:add_depfiles(sourcefile_ispc, headersfile)
- batchcmds:set_depmtime(os.mtime(objectfile))
- batchcmds:set_depcache(target:dependfile(objectfile))
- end)