Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
当 leveldb 依赖 snappy 时,编译 brpc 也需要添加 snappy 相关的 include_path、lib_path 等。
理想状态下应该判断 leveldb 使用了 snappy,才添加 snappy 相关依赖,当实际情况不是很好判断,例如系统中只找到了 libleveldb.a ,没办法通过查找符号的方式判断 libleveldb.so 中是否有 snappy 相关的符号。
因此使用了一种更简单的方式,可以通过 WITH_SNAPPY 来添加相关的依赖。当用户使用默认编译行为编译 brpc,发现 snappy 相关的错误,可以通过 WITH_SNAPPY 快速解决问题。