cmake_minimum_required (VERSION 3.16)
project(msprof_analysis VERSION 0.1.0)
set(TOP_DIR ${CMAKE_SOURCE_DIR}/../..)
aux_source_directory(${CMAKE_SOURCE_DIR}/application SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/application/credential SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/application/summary SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/application/timeline SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/application/database SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/data_process SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/data_process/ai_task SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/data_process/system SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/entities/hal SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/entities/json_trace SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/entities/metric SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/entities/tree SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/adapter SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/association SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/association/calculator/ SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/association/calculator/hccl SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/association/calculator/metric SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/association/cann SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/device_context SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/environment SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/host_worker SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/init SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/modeling SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/modeling/batch_id SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/modeling/step_trace SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/parser SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/parser/freq SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/parser/host SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/parser/host/cann SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/parser/log SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/parser/parser_item SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/parser/pmu SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/parser/track SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/persistence/device SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/domain/services/persistence/host SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/infrastructure/data_inventory SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/infrastructure/db SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/infrastructure/dfx SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/infrastructure/dump_tools SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/infrastructure/dump_tools/csv_tool SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/infrastructure/dump_tools/json_tool SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/infrastructure/process SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/infrastructure/utils SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/interface/py_interface SOURCES)
aux_source_directory(${CMAKE_SOURCE_DIR}/viewer/database/finals SOURCES)
add_library(msprof_analysis SHARED ${SOURCES})
find_package(Python REQUIRED COMPONENTS Development)
find_package(SQLite3 REQUIRED)
get_filename_component(SQLite3_LIB_DIR ${SQLite3_LIBRARIES} DIRECTORY)
target_include_directories(msprof_analysis PRIVATE
${SQLite3_INCLUDE_DIRS}
/usr/local/include/
${Python_INCLUDE_DIRS}
${TOP_DIR}
${TOP_DIR}/opensource/json/include
${TOP_DIR}/opensource/rapidjson/include
${TOP_DIR}/platform/securec/include
)
target_compile_options(msprof_analysis PRIVATE
-std=c++11
-fPIC
-fstack-protector-all
-fno-strict-aliasing
-fno-common
-fvisibility=hidden
-fvisibility-inlines-hidden
-Wfloat-equal
-Wextra
-Werror=uninitialized
-Werror=return-type
-D_GLIBCXX_USE_CXX11_ABI=0
-D_FORTIFY_SOURCE=2
-DASCEND_CI_LIMITED_PY37
$<$<NOT:$<STREQUAL:${CMAKE_BUILD_TYPE},Debug>>:-O2>
)
target_link_options(msprof_analysis PRIVATE
-Wl,-z,relro,-z,now,-z,noexecstack
-Wl,-Bsymbolic
-Wl,--exclude-libs=ALL
$<$<NOT:$<STREQUAL:${CMAKE_BUILD_TYPE},Debug>>:-s>
)
target_link_directories(msprof_analysis PRIVATE
${SQLite3_LIB_DIR}
${SECUREC_LIB_DIR}
)
target_link_libraries(msprof_analysis PRIVATE
-lsqlite3
-lpthread
c_sec
)
set_target_properties(msprof_analysis PROPERTIES PREFIX "")
install(TARGETS msprof_analysis OPTIONAL
LIBRARY DESTINATION ${CMAKE_SOURCE_DIR}/../lib64
)