cmake_minimum_required(VERSION 3.16.0)
include(cmake/fetch_cann_cmake.cmake)
project(asc-tools)
init_cann_project(PREPEND_MODULE_PATH)
add_compile_options(-Werror)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_LIST_DIR)
message(STATUS "compile project asc-tools with library")
option(BUILD_WITH_INSTALLED_DEPENDENCY_CANN_PKG "Build asc-tools with cann pkg" ON)
else()
message(STATUS "compile project asc-tools with src")
option(BUILD_WITH_INSTALLED_DEPENDENCY_CANN_PKG "Build asc-tools with cann source" OFF)
endif()
if (ENABLE_TEST)
set(CMAKE_SKIP_RPATH FALSE)
else()
set(CMAKE_SKIP_RPATH TRUE)
endif()
set(KIRIN_BUILD_CPU_DEBUG OFF)
set(CMAKE_C_FLAGS_RELEASE "")
set(CMAKE_CXX_FLAGS_RELEASE "")
if(BUILD_OPEN_PROJECT)
find_package(Python3 COMPONENTS Interpreter)
set(HI_PYTHON ${Python3_EXECUTABLE})
set(PYTHON ${Python3_EXECUTABLE})
set(PVMODEL_PATH ${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_SYSTEM_PROCESSOR}-linux/simulator)
message(STATUS "the PVMODEL_PATH is :${PVMODEL_PATH}")
include(cmake/dependencies.cmake)
include(cmake/intf_pub_linux.cmake)
include(cmake/package.cmake)
endif()
set(ASCEND_INSTALL_PATH "${ASCEND_CANN_PACKAGE_PATH}")
include(version.cmake)
if(BUILD_OPEN_PROJECT)
include(cmake/third_party/cpudebug.cmake)
endif()
check_cann_pkg_build_deps("asc-tools")
add_cann_version_info_targets()
add_subdirectory(cpudebug)
add_subdirectory(npuchk)
add_subdirectory(utils/msobjdump)
add_subdirectory(utils/optype_collector)
add_subdirectory(utils/templates)
if(BUILD_OPEN_PROJECT AND NOT ENABLE_TEST)
add_subdirectory(third_party)
endif()
add_subdirectory(utils/show_kernel_debug_data)
if(ENABLE_TEST)
add_subdirectory(tests)
endif()