diff --git a/mindspore/ccsrc/CMakeLists.txt b/mindspore/ccsrc/CMakeLists.txt index e85323c0236..7deff1e7661 100644 --- a/mindspore/ccsrc/CMakeLists.txt +++ b/mindspore/ccsrc/CMakeLists.txt @@ -259,7 +259,6 @@ endforeach() set_property(SOURCE ${SUB_OBJECTS_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_ME) add_library(mindspore STATIC ${SUB_OBJECTS_SRC}) -add_subdirectory(debug) set(COMMON_SUB_COMP transform/graph_ir utils @@ -302,6 +301,7 @@ if(NOT WIN32) endif() set(BACKEND_SUB_COMP + debug profiler ps fl @@ -353,9 +353,7 @@ if(MODE_ASCEND_ACL) add_library(mindspore_backend_static STATIC ${BACKEND_SUB_OBJECTS_SRC}) endif() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - target_link_libraries(mindspore_backend PRIVATE mindspore::pybind11_module mindspore_debug) -else() - target_link_libraries(mindspore_backend PRIVATE mindspore_debug) + target_link_libraries(mindspore_backend PRIVATE mindspore::pybind11_module) endif() target_link_libraries(mindspore_backend PRIVATE mindspore_core mindspore_common proto_input mindspore::protobuf) target_link_libraries(mindspore_backend PRIVATE securec) diff --git a/mindspore/ccsrc/cxx_api/CMakeLists.txt b/mindspore/ccsrc/cxx_api/CMakeLists.txt index e3626e5de9c..9880a3bd35c 100644 --- a/mindspore/ccsrc/cxx_api/CMakeLists.txt +++ b/mindspore/ccsrc/cxx_api/CMakeLists.txt @@ -92,7 +92,7 @@ if(BUILD_LITE) add_dependencies(mindspore_shared_lib _mindspore_transform_graph_ir_obj) elseif(MODE_ASCEND_ACL) target_link_libraries(mindspore_shared_lib PRIVATE $ - mindspore_backend_static mindspore_debug) + $ mindspore_backend_static) endif() if(NOT BUILD_LITE) set_target_properties(mindspore_shared_lib PROPERTIES OUTPUT_NAME mindspore) diff --git a/mindspore/ccsrc/debug/CMakeLists.txt b/mindspore/ccsrc/debug/CMakeLists.txt index fa536768794..7052db5798d 100644 --- a/mindspore/ccsrc/debug/CMakeLists.txt +++ b/mindspore/ccsrc/debug/CMakeLists.txt @@ -58,11 +58,11 @@ set_property(SOURCE ${_DEBUG_SRC_LIST} ${_RDR_SRC_LIST} PROPERTY COMPILE_DEFINIT list(APPEND _DEBUG_SRC_LIST ${_RDR_SRC_LIST}) list(LENGTH _DEBUG_SRC_LIST debug_files_size) if(${debug_files_size} GREATER 0) - add_library(mindspore_debug STATIC ${_DEBUG_SRC_LIST}) + add_library(_mindspore_debug_obj OBJECT ${_DEBUG_SRC_LIST}) if(CMAKE_SYSTEM_NAME MATCHES "Windows") - target_compile_definitions(mindspore_debug PRIVATE BACKEND_DLL) + target_compile_definitions(_mindspore_debug_obj PRIVATE BACKEND_DLL) endif() - add_dependencies(mindspore_debug proto_input) + add_dependencies(_mindspore_debug_obj proto_input) endif() if(ENABLE_DEBUGGER) if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows") diff --git a/tests/ut/cpp/CMakeLists.txt b/tests/ut/cpp/CMakeLists.txt index 36e3ca564cd..ae27fb46bea 100644 --- a/tests/ut/cpp/CMakeLists.txt +++ b/tests/ut/cpp/CMakeLists.txt @@ -286,6 +286,7 @@ if(USE_GLOG) endif() add_library(backend_static STATIC + $ $ $ $ @@ -304,4 +305,4 @@ add_library(backend_static STATIC $ $) target_link_libraries(ut_tests PRIVATE mindspore securec -Wl,--start-group proto_input mindspore::protobuf - mindspore_debug backend_static -Wl,--end-group) \ No newline at end of file + backend_static -Wl,--end-group) \ No newline at end of file