Merged
refactor(build): Remove link paths and include paths under ASCEND_CANN_PACKAGE_PATH. #5310
zhengfeitengAdd on Aug 6
refactor(build): Remove link paths and include paths under ASCEND_CANN_PACKAGE_PATH. #5310
Merged
Merged fromzhengfeiteng/pypto20260728-intf-pub-2intocann/pyptomaster
Total: 6 files changed+6-8
| @@ -86,6 +86,7 @@ include(cmake/func.cmake) | |||
| 86 | include(cmake/config.cmake) | 86 | include(cmake/config.cmake) |
| 87 | include(cmake/intf.cmake) | 87 | include(cmake/intf.cmake) |
| 88 | find_cann_package(acl_rt REQUIRED) | 88 | find_cann_package(acl_rt REQUIRED) |
| 89 | +find_cann_package(ascend_dump REQUIRED) | ||
| 89 | find_cann_package(ascend_hal REQUIRED) | 90 | find_cann_package(ascend_hal REQUIRED) |
| 90 | find_cann_package(hcomm REQUIRED) | 91 | find_cann_package(hcomm REQUIRED) |
| 91 | find_cann_package(runtime REQUIRED) | 92 | find_cann_package(runtime REQUIRED) |
| @@ -197,6 +198,7 @@ if (ENABLE_FEATURE_PYTHON_FRONT_END) | |||
| 197 | # libtile_fwk_bundle.so 的调用方(脱离编译前端, 仅消费 .pyptokb)需要 | 198 | # libtile_fwk_bundle.so 的调用方(脱离编译前端, 仅消费 .pyptokb)需要 |
| 198 | install(DIRECTORY framework/include/tile_fwk_bundle/ | 199 | install(DIRECTORY framework/include/tile_fwk_bundle/ |
| 199 | DESTINATION ${PyPTO_WhlName}/lib/include/tile_fwk_bundle | 200 | DESTINATION ${PyPTO_WhlName}/lib/include/tile_fwk_bundle |
| 201 | + COMPONENT pypto | ||
| 200 | PATTERN "*.h" | 202 | PATTERN "*.h" |
| 201 | PATTERN "*.hpp" | 203 | PATTERN "*.hpp" |
| 202 | PATTERN ".svn" EXCLUDE | 204 | PATTERN ".svn" EXCLUDE |
| @@ -15,7 +15,6 @@ target_include_directories(tile_fwk_intf_pub_base | |||
| 15 | $<$<BOOL:${PTO_FWK_SRC_ROOT}>:${PTO_FWK_SRC_ROOT}/framework/src> | 15 | $<$<BOOL:${PTO_FWK_SRC_ROOT}>:${PTO_FWK_SRC_ROOT}/framework/src> |
| 16 | $<$<BOOL:${PTO_FWK_SRC_ROOT}>:${PTO_FWK_SRC_ROOT}/framework/src/interface> | 16 | $<$<BOOL:${PTO_FWK_SRC_ROOT}>:${PTO_FWK_SRC_ROOT}/framework/src/interface> |
| 17 | $<$<BOOL:${PTO_FWK_SRC_ROOT}>:${PTO_FWK_SRC_ROOT}/framework/src/interface/machine/device> | 17 | $<$<BOOL:${PTO_FWK_SRC_ROOT}>:${PTO_FWK_SRC_ROOT}/framework/src/interface/machine/device> |
| 18 | - $<$<BOOL:${PTO_FWK_SRC_ROOT}>:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/include>> | ||
| 19 | ) | 18 | ) |
| 20 | target_compile_options(tile_fwk_intf_pub_base | 19 | target_compile_options(tile_fwk_intf_pub_base |
| 21 | INTERFACE | 20 | INTERFACE |
| @@ -114,10 +113,6 @@ target_compile_options(tile_fwk_intf_pub_base | |||
| 114 | # ASAN/UBSAN 公共 | 113 | # ASAN/UBSAN 公共 |
| 115 | $<$<OR:$<BOOL:${ENABLE_ASAN}>,$<BOOL:${ENABLE_UBSAN}>>:-fno-omit-frame-pointer -fsanitize-recover=all> | 114 | $<$<OR:$<BOOL:${ENABLE_ASAN}>,$<BOOL:${ENABLE_UBSAN}>>:-fno-omit-frame-pointer -fsanitize-recover=all> |
| 116 | ) | 115 | ) |
| 117 | -target_link_directories(tile_fwk_intf_pub_base | ||
| 118 | - INTERFACE | ||
| 119 | - $<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/lib64> | ||
| 120 | -) | ||
| 121 | target_link_libraries(tile_fwk_intf_pub_base | 116 | target_link_libraries(tile_fwk_intf_pub_base |
| 122 | INTERFACE | 117 | INTERFACE |
| 123 | $<$<BOOL:${ENABLE_GCOV}>:$<$<CXX_COMPILER_ID:GNU>:gcov>> | 118 | $<$<BOOL:${ENABLE_GCOV}>:$<$<CXX_COMPILER_ID:GNU>:gcov>> |
| @@ -16,8 +16,6 @@ file(GLOB_RECURSE _Utils_Srcs | |||
| 16 | add_library(tile_fwk_utils SHARED) | 16 | add_library(tile_fwk_utils SHARED) |
| 17 | target_sources(tile_fwk_utils PRIVATE ${_Utils_Srcs}) | 17 | target_sources(tile_fwk_utils PRIVATE ${_Utils_Srcs}) |
| 18 | target_include_directories(tile_fwk_utils | 18 | target_include_directories(tile_fwk_utils |
| 19 | - PUBLIC | ||
| 20 | - $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/base>> | ||
| 21 | PRIVATE | 19 | PRIVATE |
| 22 | ${CMAKE_CURRENT_SOURCE_DIR} | 20 | ${CMAKE_CURRENT_SOURCE_DIR} |
| 23 | ) | 21 | ) |
| @@ -30,6 +30,7 @@ target_compile_options(${_Target} | |||
| 30 | ) | 30 | ) |
| 31 | target_link_libraries(${_Target} | 31 | target_link_libraries(${_Target} |
| 32 | INTERFACE | 32 | INTERFACE |
| 33 | + $<BUILD_INTERFACE:c_sec_headers> | ||
| 33 | tile_fwk_intf_pub | 34 | tile_fwk_intf_pub |
| 34 | json | 35 | json |
| 35 | ) | 36 | ) |
| @@ -20,6 +20,7 @@ target_compile_options(${_Target} | |||
| 20 | ) | 20 | ) |
| 21 | target_link_libraries(${_Target} | 21 | target_link_libraries(${_Target} |
| 22 | INTERFACE | 22 | INTERFACE |
| 23 | + $<BUILD_INTERFACE:c_sec_headers> | ||
| 23 | tile_fwk_intf_pub | 24 | tile_fwk_intf_pub |
| 24 | json | 25 | json |
| 25 | ) | 26 | ) |
| @@ -537,7 +537,8 @@ class CMakeBuild(build_ext, CMakeUserOption, EditModeHelper): | |||
| 537 | cmake_install_prefix = self._get_cmake_install_prefix() | 537 | cmake_install_prefix = self._get_cmake_install_prefix() |
| 538 | 538 | ||
| 539 | params = CMakeCmdParams( | 539 | params = CMakeCmdParams( |
| 540 | - src=src, build_dir=build_dir, cmake_install_prefix=cmake_install_prefix, py3_exe=sys.executable, env=env | 540 | + src=src, build_dir=build_dir, cmake_install_prefix=cmake_install_prefix, py3_exe=sys.executable, env=env, |
| 541 | + install_components=['pypto'] | ||
| 541 | ) | 542 | ) |
| 542 | 543 | ||
| 543 | # 主版本构建 | 544 | # 主版本构建 |