summaryrefslogtreecommitdiff
path: root/xmake/rules
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-12 22:34:48 +0800
committerruki <[email protected]>2020-06-12 09:28:51 +0800
commitcf1df0402b2fdcb1c6d8d4f35385f153a036dc24 (patch)
tree353270c8ba9680160686ca26a4fa54b7e909a08a /xmake/rules
parent2daaee9087bf3a503831d8dfb141baa328cbac43 (diff)
improve protobuf
Diffstat (limited to 'xmake/rules')
-rw-r--r--xmake/rules/protobuf/proto.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/rules/protobuf/proto.lua b/xmake/rules/protobuf/proto.lua
index 24c482186..b7ad10eae 100644
--- a/xmake/rules/protobuf/proto.lua
+++ b/xmake/rules/protobuf/proto.lua
@@ -52,7 +52,9 @@ function main(target, sourcekind, sourcefile_proto, opt)
protoc = assert(target:data(sourcekind == "cxx" and "protobuf.protoc" or "protobuf.protoc-c"), "protoc not found!")
-- get c/c++ source file for protobuf
- local sourcefile_cx = path.join(target:autogendir(), "rules", "protobuf", path.basename(sourcefile_proto) .. ".pb" .. (sourcekind == "cxx" and ".cc" or "-c.c"))
+ local rootdir = path.join(target:autogendir(), "rules", "protobuf")
+ local filename = path.basename(sourcefile_proto) .. ".pb" .. (sourcekind == "cxx" and ".cc" or "-c.c")
+ local sourcefile_cx = target:autogenfile(sourcefile_proto, {rootdir = rootdir, filename = filename})
local sourcefile_dir = path.directory(sourcefile_cx)
-- add includedirs