fix util.iscp generate path
@@ -2,9 +2,9 @@ rule("utils.ispc")
set_extensions(".ispc")
on_load(function (target)
- local header_outputdir = path.join(target:autogendir(), "ispc_headers")
- os.mkdir(header_outputdir)
- target:add("includedirs", header_outputdir, {public = true})
+ 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")
@@ -40,15 +40,9 @@ rule("utils.ispc")
table.insert(flags, "--pic")
end
- local obj_extension = ".o"
- if target:is_plat("windows") then
- obj_extension = ".obj"
- end
-
- local headersdir = path.join(target:autogendir(), "ispc_headers")
- local objectdir = path.join(target:autogendir(), "ispc_objs")
- local objectfile = path.join(objectdir, path.filename(sourcefile_ispc) .. obj_extension)
- batchcmds:mkdir(objectdir)
+ local headersdir = path.join(target:autogendir(), "rules", "utils", "ispc", "headers")
+ local objectdir = path.join(target:autogendir(), "rules", "utils", "ispc", "objs")
+ local objectfile = path.join(objectdir, path.filename(target:objectfile(sourcefile_ispc)))
local headersfile
local header_extension = target:extraconf("rules", "utils.ispc", "header_extension")
@@ -64,6 +58,7 @@ rule("utils.ispc")
table.insert(flags, path(headersfile))
table.insert(flags, path(sourcefile_ispc))
batchcmds:show_progress(opt.progress, "${color.build.object}compiling %s", sourcefile_ispc)
+ batchcmds:mkdir(objectdir)
batchcmds:vrunv(ispc.program, flags)
table.insert(target:objectfiles(), objectfile)
