Then, you can set some options to compiler, e.g. the search path, the unknown handlers, etc.
p.paths[#p.paths+1] = "whatever/folder/hold/.proto/files"
p.unknown_module = function(self, module_name) ... end
p.unknown_type = function(self, type_name) ... end
sub.import_fallback中使用的self.unknown_import和self.import_fallback字段和文档中描述(unknown_module)不一致.
https://github.com/starwing/lua-protobuf/blob/acfaeddf6c3bdd89d1f5e69e88d415f589bb8d35/protoc.lua#L439
https://github.com/starwing/lua-protobuf/blob/acfaeddf6c3bdd89d1f5e69e88d415f589bb8d35/protoc.lua#L437
Then, you can set some options to compiler, e.g. the search path, the unknown handlers, etc. p.paths[#p.paths+1] = "whatever/folder/hold/.proto/files" p.unknown_module = function(self, module_name) ... end p.unknown_type = function(self, type_name) ... end