Pull Request has been successfully merged by CANN-robot.
(Thank you for zhaoyingdong's contribution.)变更摘要
此 PR 主要完成了两项工作:一是将所有第三方库的补丁文件(.patch)统一迁移至 third_party/patch/ 目录下集中管理;二是将 mockcpp 和 pybind11 的补丁/源码下载从 configure 阶段(file(DOWNLOAD) / execute_process)迁移至 build 阶段(ExternalProject_Add),使构建流程更规范。同时为 20 余个 ExternalProject_Add 调用统一添加了 TIMEOUT 超时参数,并为部分 cmake 文件补充了 CMAKE_C_COMPILER_LAUNCHER / CMAKE_CXX_COMPILER_LAUNCHER 编译加速器支持。此外还对 mockcpp.cmake 的构建逻辑做了简化清理。
主要改动
-
补丁文件统一迁移至
third_party/patch/目录:将grpc-fix-compile-bug-in-device.patch、json_3.12.0_change_version.patch、protobuf-hide_absl_symbols.patch、protobuf_25.1_change_version.patch、re2-add_compatible_functions.patch、symengine_add_mod.patch、zlib_add_minizip_static_lib.patch共 7 个补丁文件从third_party/根目录迁移到third_party/patch/,相应.cmake文件中的PATCH_COMMAND路径全部更新为${CMAKE_CURRENT_LIST_DIR}/patch/...。 -
mockcpp补丁下载从 configure 阶段迁移至 build 阶段:移除原有的file(DOWNLOAD ...)方式下载补丁,改为ExternalProject_Add(mockcpp_patch ...)在 build 阶段下载并校验 SHA256;mockcpp_static_build新增DEPENDS mockcpp_patch依赖;补丁应用方式从git init && git apply改为patch -p1。 -
pybind11源码获取方式从 configure 迁移至 build 阶段:移除file(DOWNLOAD)+execute_process(tar)的 configure 阶段下载解压逻辑,改用ExternalProject_Add(pybind11_build ...)在 build 阶段完成下载解压;安装路径从${CANN_3RD_LIB_PATH}/pybind11调整为${CANN_3RD_LIB_PATH}/lib_cache/pybind11。 -
mockcpp.cmake构建逻辑简化:移除ABI_ZERO变量及相关条件分支,统一使用USE_CXX11_ABI控制_GLIBCXX_USE_CXX11_ABI;移除BUILD_WRAPPER、BUILD_TYPE、IS_MAKE等变量及条件编译逻辑,BUILD_COMMAND统一为$(MAKE);移除find_package_handle_standard_args检查调用。 -
统一为
ExternalProject_Add添加TIMEOUT超时参数:在abseil-cpp、boost、grpc、protobuf、gtest、openssl、eigen、llvm、re2、zlib、json、jpeg、symengine、rdma-core、seccomp、cares、csec、benchmark、libboundscheck、makeself-fetch、secure_c等 20 余个 cmake 文件中新增TIMEOUT 60/TIMEOUT 300/TIMEOUT 600配置,防止下载操作无限等待。


Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/cmake | ✅ 宋常霞, yangbinhua (2/2) | ✅ 宋常霞 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhaoyingdong, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/compile


/lgtm


/approve
/lgtm


当前PR是否有AI参与:
[x] 否
[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :
PR功能描述 / 为什么需要这个合入**:
统一patch到third_party/patch目录,mockcpp补丁下载从configure迁移至build阶段
该PR关联的issue
(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #
希望检视人员了解:
改动类型 / Change Type
测试信息 / Testing
检查清单 / Checklist