diff options
| author | A2va <[email protected]> | 2023-10-13 09:05:50 +0200 |
|---|---|---|
| committer | A2va <[email protected]> | 2023-10-13 09:05:50 +0200 |
| commit | bf3b4234d48cd8a9ece936886d48f71f66db8a08 (patch) | |
| tree | aee40cd3844bf0739de29cc4c23a7a353d454eb5 | |
| parent | 654050350b33b0f2dc6d472404b14ddd9795592c (diff) | |
Fix proto grpc build on windows
| -rw-r--r-- | xmake/rules/protobuf/proto.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/rules/protobuf/proto.lua b/xmake/rules/protobuf/proto.lua index fee266087..561526ef1 100644 --- a/xmake/rules/protobuf/proto.lua +++ b/xmake/rules/protobuf/proto.lua @@ -52,7 +52,7 @@ end -- get grpc_cpp_plugin function _get_grpc_cpp_plugin(target, sourcekind) assert(sourcekind == "cxx", "grpc_cpp_plugin only support c++") - local grpc_cpp_plugin = find_tool("grpc_cpp_plugin", {norun = true}) + local grpc_cpp_plugin = find_tool("grpc_cpp_plugin", {norun = true, force = true, envs = target:pkgenvs()}) return assert(grpc_cpp_plugin and grpc_cpp_plugin.program, "grpc_cpp_plugin not found!") end @@ -143,7 +143,8 @@ function buildcmd(target, batchcmds, sourcefile_proto, opt, sourcekind) } if grpc_cpp_plugin then - table.insert(protoc_args, "--plugin=protoc-gen-grpc=" .. grpc_cpp_plugin_bin) + local exe = is_plat("windows") and ".exe" or "" + table.insert(protoc_args, "--plugin=protoc-gen-grpc=" .. grpc_cpp_plugin_bin .. exe) table.insert(protoc_args, path(sourcefile_dir, function (p) return ("--grpc_out=") .. p end)) end |
