summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChi Huu Huynh <[email protected]>2023-11-26 15:36:59 +0000
committerChi Huu Huynh <[email protected]>2023-11-26 15:36:59 +0000
commit8b42f01c723d95d9dd8213f9f23f742435a64016 (patch)
tree285d2d8c4be39b11340a1b99abcef5754f886cef
parent8defb4b8ee5be0d4e7dc7dac4aaef4a4a335cf60 (diff)
Prevent proto compile twice
-rw-r--r--xmake/rules/protobuf/proto.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/rules/protobuf/proto.lua b/xmake/rules/protobuf/proto.lua
index f79301462..fec3404e7 100644
--- a/xmake/rules/protobuf/proto.lua
+++ b/xmake/rules/protobuf/proto.lua
@@ -146,6 +146,16 @@ function buildcmd_pfiles(target, batchcmds, sourcefile_proto, opt, sourcekind)
sourcefile_proto
)
batchcmds:vrunv(protoc, protoc_args)
+
+ -- add deps
+ local depmtime = os.mtime(sourcefile_cx)
+ batchcmds:add_depfiles(sourcefile_proto)
+ batchcmds:set_depcache(target:dependfile(sourcefile_cx))
+ if grpc_cpp_plugin then
+ batchcmds:set_depmtime(math.max(os.mtime(sourcefile_cx_grpc), depmtime))
+ else
+ batchcmds:set_depmtime(depmtime)
+ end
end
function buildcmd_cxfiles(target, batchcmds, sourcefile_proto, opt, sourcekind)