.clangd:根据文件扩展名使用不同的编译器标志
我正在使用 .clangd 配置文件将编译标志传递给 clangd。
我在包含 C 和 C++ 文件的代码库上运行 clangd。
如何让一些标志应用于 C++ 文件而不是 C 文件?
I am using the .clangd
configuration file to pass compilation flags to clangd.
I run clangd on a codebase with C and C++ files.
How can I have some flags apply to C++ files but not C files ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用多个片段和
If
块语法。示例:
---
分隔片段。PathMatch
可能比PathExclude
更实用,具体取决于代码库中的扩展。我在 clangd 13.0.0 上对此进行了测试。
我从此 Github 问题获得了帮助。
更多帮助请参见 clangd 官方文档。
You can use multiple fragments and the
If
block syntax.Example:
---
delimits fragments.PathMatch
could be more practical thanPathExclude
depending on the extensions in your codebase.I tested this on clangd 13.0.0.
I got help from this Github issue.
More help in clangd official documentation.