summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-03-19 00:58:44 +0800
committerruki <[email protected]>2021-03-19 00:58:44 +0800
commit820d692e187cf2955db810314b6df02c9d093dc4 (patch)
treeddc40becb885180fdd7ad99532606ea8c82b59ba
parent3b27d07da4a9b5156bac808fab0a826d5e02d63c (diff)
fix bpf rule
-rw-r--r--xmake/rules/platform/linux/bpf/xmake.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/rules/platform/linux/bpf/xmake.lua b/xmake/rules/platform/linux/bpf/xmake.lua
index 9a67c32cf..165e71dce 100644
--- a/xmake/rules/platform/linux/bpf/xmake.lua
+++ b/xmake/rules/platform/linux/bpf/xmake.lua
@@ -25,6 +25,9 @@ rule("platform.linux.bpf")
on_config(function (target)
assert(is_host("linux"), 'rule("platform.linux.bpf"): only supported on linux!')
local headerdir = path.join(target:autogendir(), "rules", "bpf")
+ if not os.isdir(headerdir) then
+ os.mkdir(headerdir)
+ end
target:add("includedirs", headerdir)
end)
before_buildcmd_file(function (target, batchcmds, sourcefile, opt)
@@ -35,7 +38,7 @@ rule("platform.linux.bpf")
batchcmds:mkdir(path.directory(objectfile))
batchcmds:compile(sourcefile, objectfile, {configs = {force = {cxflags = {"-target bpf", "-g"}, defines = "__TARGET_ARCH_x86"}}})
batchcmds:mkdir(path.directory(headerfile))
- batchcmds:vrunv("bpftool", {"gen", "skeleton", objectfile}, {stdout = headerfile})
+ batchcmds:execv("bpftool", {"gen", "skeleton", objectfile}, {stdout = headerfile})
batchcmds:add_depfiles(sourcefile)
batchcmds:set_depmtime(os.mtime(headerfile))
batchcmds:set_depcache(target:dependfile(headerfile))