-
-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_rules("protobuf.cpp") 应该以 host 方式编译 并使用 protoc #5399
Comments
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 solutionsadd_rules("protobuf.cpp") should be compiled in host mode and use protoc Describe your alternativesNo response other informationNo response |
目前这个包原本就还不支持交叉编译。你可以提 pr 过来改进这个包。 |
Currently, this package does not originally support cross-compilation. You can submit a PR to improve this package. |
我改进了一下 protoc 包,原来是直接下载预编译二进制,现在是 binary package,永远只会构建 host tool。 package("protoc")
set_kind("binary")
add_deps("protobuf-cpp")
on_install(function (package) end)
on_test(function (package)
os.vrun("protoc --version")
end) protoc 的版本需要用 add_requireconfs 指定。 add_requires("protoc", "protobuf-cpp")
add_requireconfs("protoc.protobuf-cpp", {version = "1.0.0"})
add_packages("protoc", "protobuf-cpp") 如果不用 protoc 包,交叉编译就这样: add_requires("protobuf-cpp~host", {host = true, alias = "protoc"})
add_requires("protobuf-cpp")
add_packages("protoc", {links = {}})
add_packages("protobuf-cpp") |
如果用法变了,最好同步下 tests example 和相关文档 https://github.com/xmake-io/xmake/blob/dev/tests/projects/c%2B%2B/protobuf/xmake.lua |
你在什么场景下需要该功能?
目前的版本,交叉编译时,protoc 也交叉编译了,造成交叉编译时不会基于 proto文件生成 .pb.cc 和 .pb.h
描述可能的解决方案
add_rules("protobuf.cpp") 应该以 host 方式编译 并使用 protoc
描述你认为的候选方案
No response
其他信息
No response
The text was updated successfully, but these errors were encountered: