From e96506ac537795a441e27338f485564fc11fdf5c Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 22 May 2022 19:28:29 +0800 Subject: improve protobuf rule --- xmake/rules/protobuf/proto.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake/rules/protobuf/proto.lua b/xmake/rules/protobuf/proto.lua index 56d3bcdec..9c20857ff 100644 --- a/xmake/rules/protobuf/proto.lua +++ b/xmake/rules/protobuf/proto.lua @@ -109,9 +109,9 @@ function buildcmd(target, batchcmds, sourcefile_proto, opt, sourcekind) -- add commands batchcmds:mkdir(sourcefile_dir) batchcmds:show_progress(opt.progress, "${color.build.object}compiling.proto %s", sourcefile_proto) - batchcmds:vrunv(protoc, {sourcefile_proto, - "-I" .. (prefixdir and prefixdir or path.directory(sourcefile_proto)), - (sourcekind == "cxx" and "--cpp_out=" or "--c_out=") .. sourcefile_dir}) + batchcmds:vrunv(protoc, {path(sourcefile_proto), + path(prefixdir and prefixdir or path.directory(sourcefile_proto), function (p) return "-I" .. p end), + path(sourcefile_dir, function (p) return (sourcekind == "cxx" and "--cpp_out=" or "--c_out=") .. p end)}) batchcmds:compile(sourcefile_cx, objectfile, {configs = {includedirs = sourcefile_dir, languages = (sourcekind == "cxx" and "c++11")}}) -- add deps -- cgit v1.3.1