[cmake] fix cmake with the same name already exists #54391
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.
PR types
Others
PR changes
Others
Description
BUG1:
修复重名文件无法覆盖的情况
不过这样可能会导致每次
cmake
后make -j
都执行文件的解压缩CMake Error at cmake/external/brpc.cmake:26 (add_library): add_library cannot create imported target "crypto" because another target with the same name already exists. Call Stack (most recent call first): cmake/third_party.cmake:403 (include) CMakeLists.txt:566 (include)
BUG2:
以
leveldb
为例, 如果直接修改, 将不会自动重新触发编译目前有个解决方案就是在
git checkout
的时候去清除文件暂时修复
libmct
,lapack
,mklml
(bug2在此条pr修复,bug1不清楚是否需要修复,因为它并不会导致整个cmake失败)