xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.81k stars 774 forks source link

add_rules("protobuf.cpp") 应该以 host 方式编译 并使用 protoc #5399

Open 19317362 opened 1 month ago

19317362 commented 1 month ago

你在什么场景下需要该功能?

目前的版本,交叉编译时,protoc 也交叉编译了,造成交叉编译时不会基于 proto文件生成 .pb.cc 和 .pb.h

描述可能的解决方案

add_rules("protobuf.cpp") 应该以 host 方式编译 并使用 protoc

描述你认为的候选方案

No response

其他信息

No response

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Title: add_rules("protobuf.cpp") should be compiled in host mode and use protoc

In what scenario do you need this feature?

In the current version, when cross-compiling, protoc is also cross-compiled, causing .pb.cc and .pb.h to not be generated based on the proto file during cross-compilation.

Describe possible solutions

add_rules("protobuf.cpp") should be compiled in host mode and use protoc

Describe your alternatives

No response

other information

No response

waruqi commented 1 month ago

目前这个包原本就还不支持交叉编译。你可以提 pr 过来改进这个包。

https://github.com/xmake-io/xmake-repo/blob/3a7bd844fd0f9d9702b9bbd11710d1fa685c99e8/packages/p/protobuf-cpp/xmake.lua#L54

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Currently, this package does not originally support cross-compilation. You can submit a PR to improve this package.

https://github.com/xmake-io/xmake-repo/blob/3a7bd844fd0f9d9702b9bbd11710d1fa685c99e8/packages/p/protobuf-cpp/xmake.lua#L54