We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
使用文档用的protobuf工程例子,然后生成对应的compiler_commands.json文件。由于编译命令中没有指定pb的include目录,IDE使用compiler_commands.json无法做出代码提示。不知道这是否符合预期。
[ { "directory": "/Users/name/repos/xmake/hello", "arguments": [ "/usr/local/bin/ccache", "/usr/local/opt/llvm/bin/clang++", "-c", "-Qunused-arguments", "-arch", "x86_64", "-std=c++11", "-I/Users/name/.xmake/packages/p/protobuf-cpp/3.12.3/d639b7d6e3244216b403b39df5101abf/include", "-I/usr/local/include", "-I/usr/include", "-o", "build/.objs/hello/macosx/x86_64/release/src/main.cpp.o", "src/main.cpp" ], "file": "src/main.cpp" } ]
add_requires("protobuf-cpp") target("hello") set_kind("binary") set_languages("c++11") add_packages("protobuf-cpp") add_files("src/*.cpp") add_files("src/*.proto", {rules = "protobuf.cpp"})
#include <iostream> #include <string> #include "request.pb.h" using namespace std; int main(int argc, char** argv) { return 0; }
syntax = "proto3"; message SearchRequest { string query = 1; int32 page_number = 2; int32 result_per_page = 3; }
希望include地址可以把pb生成的代码路径加入
请提供编译和运行环境信息,下面是一些必须填写的基础信息,便于我们针对性排查问题:
The text was updated successfully, but these errors were encountered:
pb.h的自动生成是在 protobuf 规则的 on_build_file() 脚本里面直接处理的,而 compile_commands 里面目前不支持导出所有的 on_xxx() 脚本内部的各种命令,因此目前是不支持导出pb.h 路径到 compile_commands 的。
on_build_file()
这块后期要支持,理论上也是可以,但是要花点时间,可以先在这备着吧,在之后的版本中,如果有时间我会考虑下的。
Sorry, something went wrong.
我在 generator 分支上改进过了,应该支持了,可以更新下试试
xmake update -s github:xmake-io/xmake#generator
No branches or pull requests
描述问题
使用文档用的protobuf工程例子,然后生成对应的compiler_commands.json文件。由于编译命令中没有指定pb的include目录,IDE使用compiler_commands.json无法做出代码提示。不知道这是否符合预期。
compile_commands.json
xmake.lua
src/main.cpp
src/request.proto
期待的结果
希望include地址可以把pb生成的代码路径加入
错误信息
相关环境
请提供编译和运行环境信息,下面是一些必须填写的基础信息,便于我们针对性排查问题:
The text was updated successfully, but these errors were encountered: