diff --git a/api/xmake.lua b/api/xmake.lua index dd43351..823cd71 100644 --- a/api/xmake.lua +++ b/api/xmake.lua @@ -2,7 +2,7 @@ set_xmakever("2.6.1") -- Minimum version to compile BPF source correctly -- includes -includes("xmake/repos.lua") +includes("../xmake/repos.lua") -- rules add_rules("mode.release", "mode.debug") @@ -30,4 +30,4 @@ target("api") import("actions.config.configfiles", { alias = "gen_configfiles", rootdir = os.programdir() }) gen_configfiles() - end) \ No newline at end of file + end) diff --git a/bpf/xmake.lua b/bpf/xmake.lua index 0379913..d36b061 100644 --- a/bpf/xmake.lua +++ b/bpf/xmake.lua @@ -15,6 +15,7 @@ rule("bpf") target:add("includedirs", headerdir, { interface = true }) end) before_buildcmd_file(function (target, batchcmds, sourcefile, opt) + local filecfg = target:fileconfig(sourcefile) local bpftool = "bpftool" if filecfg and filecfg.bpftool then @@ -36,6 +37,7 @@ rule("bpf") targetarch = "__TARGET_ARCH_powerpc" end target:add("includedirs", path.directory(headerfile), { interface = true }) + target:set("optimize", "faster") batchcmds:show_progress(opt.progress, "${color.build.object}compiling.bpf %s", sourcefile) batchcmds:mkdir(path.directory(objectfile)) diff --git a/xmake.lua b/xmake.lua index b0bf9ca..af5127b 100644 --- a/xmake.lua +++ b/xmake.lua @@ -12,6 +12,7 @@ target("traffico") set_default(true) includes("api") add_deps("api") + add_deps("bpf") add_packages("libbpf") add_files({ "traffico.c" }, { languages = { "c11" }}) target_end() @@ -23,6 +24,7 @@ target("traffico-cni") add_packages("cjson") includes("api") add_deps("api") + add_deps("bpf") add_packages("libbpf") add_files({ "traffico-cni.c" }, { languages = { "c11" }}) target_end()