support for msvc debug compile

This commit is contained in:
qiuzhongya 2022-10-08 20:16:44 +08:00
parent ca49c7577c
commit 05f66e911e
3 changed files with 17 additions and 5 deletions

View File

@ -29,7 +29,7 @@ else()
set(_ms_tmp_CMAKE_STATIC_LIBRARY_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
if(DEBUG_MODE)
set(opencv_Debug ON)
set(protobuf_Debug ON)
endif()
else()
set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter \

View File

@ -85,7 +85,11 @@ install(
if(USE_GLOG)
if(MSVC)
if(DEBUG_MODE)
file(GLOB_RECURSE GLOG_LIB_LIST ${glog_LIBPATH}/mindspore_glogd.dll)
else()
file(GLOB_RECURSE GLOG_LIB_LIST ${glog_LIBPATH}/mindspore_glog.dll)
endif()
else()
file(GLOB_RECURSE GLOG_LIB_LIST ${glog_LIBPATH}/libmindspore_glog.dll)
endif()
@ -123,7 +127,11 @@ if(ENABLE_MINDDATA)
)
if(MSVC)
if(DEBUG_MODE)
file(GLOB_RECURSE TINYXML2_LIB_LIST ${tinyxml2_LIBPATH}/tinyxml2d.dll)
else()
file(GLOB_RECURSE TINYXML2_LIB_LIST ${tinyxml2_LIBPATH}/tinyxml2.dll)
endif()
else()
file(GLOB_RECURSE TINYXML2_LIB_LIST ${tinyxml2_LIBPATH}/libtinyxml2.dll)
endif()

View File

@ -133,7 +133,7 @@ function(__find_pkg_then_add_target pkg_name pkg_exe lib_path)
endif()
set(_LIB_TYPE SHARED)
if(${pkg_name}_USE_STATIC_LIBS)
set(_LIB_SEARCH_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}${_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(_LIB_SEARCH_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}${_LIB_SEARCH_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(_LIB_TYPE STATIC)
endif()
set(${_LIB_NAME}_LIB ${_LIB_NAME}_LIB-NOTFOUND)
@ -384,7 +384,11 @@ function(mindspore_add_pkg pkg_name)
-DCMAKE_INSTALL_PREFIX=${${pkg_name}_BASE_DIR} ${${pkg_name}_SOURCE_DIR}/${PKG_CMAKE_PATH}
WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build)
if(MSVC)
__exec_cmd(COMMAND ${CMAKE_COMMAND} --build . --config Release --target install --
set(CONFIG_TYPE Release)
if(DEBUG_MODE)
set(CONFIG_TYPE Debug)
endif()
__exec_cmd(COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG_TYPE} --target install --
WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build)
else()
__exec_cmd(COMMAND ${CMAKE_COMMAND} --build . --target install -- -j${THNUM}