summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-06-28 09:05:26 +0800
committerGitHub <[email protected]>2023-06-28 09:05:26 +0800
commit6e0b9f7e44c862d9ed5c6d675d353bca8b481896 (patch)
tree2ad505b82a91f4facbd77dfaf18f8c2624656252
parent8ce4384fab8a343c4f5abe3ecf9456694b2c1d42 (diff)
Update proto.lua
-rw-r--r--xmake/rules/protobuf/proto.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/xmake/rules/protobuf/proto.lua b/xmake/rules/protobuf/proto.lua
index 5a11f1c42..349864e9e 100644
--- a/xmake/rules/protobuf/proto.lua
+++ b/xmake/rules/protobuf/proto.lua
@@ -99,6 +99,7 @@ function buildcmd(target, batchcmds, sourcefile_proto, opt, sourcekind)
local prefixdir
local autogendir
local public
+ local grpc_cpp_plugin
local fileconfig = target:fileconfig(sourcefile_proto)
if fileconfig then
public = fileconfig.proto_public
@@ -135,7 +136,7 @@ function buildcmd(target, batchcmds, sourcefile_proto, opt, sourcekind)
table.insert(target:objectfiles(), objectfile_grpc)
end
- local protoc_args = {
+ local protoc_args = {
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)
@@ -154,18 +155,16 @@ function buildcmd(target, batchcmds, sourcefile_proto, opt, sourcekind)
if grpc_cpp_plugin then
batchcmds:compile(sourcefile_cx_grpc, objectfile_grpc, {configs = {includedirs = sourcefile_dir}})
end
+
-- add deps
- local depmtime = os.mtime(objectfile);
+ local depmtime = os.mtime(objectfile)
batchcmds:add_depfiles(sourcefile_proto)
-
+ batchcmds:set_depcache(target:dependfile(objectfile))
if grpc_cpp_plugin then
batchcmds:set_depmtime(math.max(os.mtime(objectfile_grpc), depmtime))
else
batchcmds:set_depmtime(depmtime)
end
-
- batchcmds:set_depcache(target:dependfile(objectfile))
-
end
-- build batch jobs