summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-06-09 23:56:51 +0800
committerruki <[email protected]>2021-06-09 23:56:51 +0800
commit1a175f8da955323de9536c1230fa05dad2a23122 (patch)
tree95662f12baab21ade044a570279214a325ff6b0e
parent79acd86359c71f749b6990b24335bfe2c338f95b (diff)
improve protobuf 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 7a29d8b4a..fd93546d6 100644
--- a/xmake/rules/protobuf/proto.lua
+++ b/xmake/rules/protobuf/proto.lua
@@ -54,8 +54,10 @@ function buildcmd(target, batchcmds, sourcefile_proto, opt, sourcekind)
-- get c/c++ source file for protobuf
local prefixdir
+ local public
local fileconfig = target:fileconfig(sourcefile_proto)
if fileconfig then
+ public = fileconfig.proto_public
prefixdir = fileconfig.proto_rootdir
end
local rootdir = path.join(target:autogendir(), "rules", "protobuf")
@@ -64,7 +66,7 @@ function buildcmd(target, batchcmds, sourcefile_proto, opt, sourcekind)
local sourcefile_dir = prefixdir and path.join(rootdir, prefixdir) or path.directory(sourcefile_cx)
-- add includedirs
- target:add("includedirs", sourcefile_dir)
+ target:add("includedirs", sourcefile_dir, {public = public})
-- add objectfile
local objectfile = target:objectfile(sourcefile_cx)