build(cmake): fix curl link of prometheus #397
Merged
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.
What problem does this PR solve?
使用find_package导入prometheus后, 由于prometheus-cpp的export写的不够灵活, INTERFACE_LINK_LIBRARIES中的curl库是绝对地址.
这就导致travis的build出现问题, 因为travis中thirdparty是prebuild的, 所以curl路径写死了为:
/home/travis/build/XiaoMi/pegasus/rdsn/thirdparty/output/lib/libcurl.a
.这样的话, 我们个人的pegasus分支跑travis都会出现找不到
/home/travis/build/XiaoMi/pegasus/rdsn/thirdparty/output/lib/libcurl.a
的问题, 而编译失败.What is changed and how it works?
现在提的解决方法是, 通过替换prometheus的INTERFACE_LINK_LIBRARIES为当前工程中能find到的curl库路径.
还有一个工作量大点的方案是, 将prometheus改成optional的, 不指定编译, 就不要编了. 之后也可以考虑将redis/geo等也做成optional. 更进一步地, 下载thirdparty也可以选项化.
大家看看有没有必要
Check List
Tests