Add Convertor function for windows enviroment

This commit is contained in:
liuwenhao4 2020-08-26 14:13:58 +08:00
parent 9f13170217
commit 8b2dc47a64
3 changed files with 14 additions and 7 deletions

View File

@ -55,6 +55,9 @@ IF "%1%" == "lite" (
IF errorlevel 1 ( IF errorlevel 1 (
echo "build fail." echo "build fail."
goto run_fail goto run_fail
) ELSE (
cd %BASEPATH%/output
rd /s /q _CPack_Packages
) )
) ELSE ( ) ELSE (
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON ^ cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON ^

View File

@ -45,9 +45,9 @@ elseif (PLATFORM_ARM32)
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
get_filename_component(CXX_DIR ${CMAKE_CXX_COMPILER} PATH) get_filename_component(CXX_DIR ${CMAKE_CXX_COMPILER} PATH)
file(GLOB LIB_LIST ${CXX_DIR}/libstdc++-6.dll ${CXX_DIR}/libwinpthread-1.dll ${CXX_DIR}/libssp-0.dll ${CXX_DIR}/libgcc_s_seh-1.dll) file(GLOB LIB_LIST ${CXX_DIR}/libstdc++-6.dll ${CXX_DIR}/libwinpthread-1.dll ${CXX_DIR}/libssp-0.dll ${CXX_DIR}/libgcc_s_seh-1.dll)
install(FILES ${TOP_DIR}/build/mindspore/tools/converter/converter_lite.exe DESTINATION ${TOP_DIR}/output COMPONENT ${COMPONENT_NAME}) install(FILES ${TOP_DIR}/build/mindspore/tools/converter/converter_lite.exe DESTINATION ${TOP_DIR}/build/mindspore/package COMPONENT ${COMPONENT_NAME})
install(FILES ${LIB_LIST} DESTINATION ${TOP_DIR}/output COMPONENT ${COMPONENT_NAME}) install(FILES ${LIB_LIST} DESTINATION ${TOP_DIR}/build/mindspore/package COMPONENT ${COMPONENT_NAME})
install(FILES ${TOP_DIR}/build/mindspore/tools/converter/libconverter_parser.a DESTINATION ${TOP_DIR}/output COMPONENT ${PARSER_NAME}) install(FILES ${TOP_DIR}/build/mindspore/tools/converter/libconverter_parser.a DESTINATION ${TOP_DIR}/build/mindspore/package COMPONENT ${PARSER_NAME})
else () else ()
install(FILES ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so DESTINATION ${LIB_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME}) install(FILES ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so DESTINATION ${LIB_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME})
install(FILES ${TOP_DIR}/third_party/protobuf/build/lib/libprotobuf.so.19.0.0 DESTINATION ${PROTOBF_DIR}/lib RENAME libprotobuf.so.19 COMPONENT ${COMPONENT_NAME}) install(FILES ${TOP_DIR}/third_party/protobuf/build/lib/libprotobuf.so.19.0.0 DESTINATION ${PROTOBF_DIR}/lib RENAME libprotobuf.so.19 COMPONENT ${COMPONENT_NAME})
@ -62,11 +62,15 @@ set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
if (PLATFORM_ARM64 OR PLATFORM_ARM32) if (PLATFORM_ARM64 OR PLATFORM_ARM32)
set(CPACK_COMPONENTS_ALL ${COMPONENT_NAME}) set(CPACK_COMPONENTS_ALL ${COMPONENT_NAME})
elseif (WIN32) elseif (WIN32)
set(CPACK_COMPONENTS_ALL ${COMPONENT_NAME} ${PARSER_NAME}) set(CPACK_COMPONENTS_ALL ${COMPONENT_NAME})
else () else ()
set(CPACK_COMPONENTS_ALL ${COMPONENT_NAME} ${RUN_X86_COMPONENT_NAME}) set(CPACK_COMPONENTS_ALL ${COMPONENT_NAME} ${RUN_X86_COMPONENT_NAME})
endif () endif ()
set(CPACK_PACKAGE_FILE_NAME ${MAIN_DIR}) set(CPACK_PACKAGE_FILE_NAME ${MAIN_DIR})
set(CPACK_PACKAGE_DIRECTORY ${TOP_DIR}/output/tmp) if (WIN32)
set(CPACK_PACKAGE_DIRECTORY ${TOP_DIR}/output)
else ()
set(CPACK_PACKAGE_DIRECTORY ${TOP_DIR}/output/tmp)
endif()
set(CPACK_PACKAGE_CHECKSUM SHA256) set(CPACK_PACKAGE_CHECKSUM SHA256)
include(CPack) include(CPack)

View File

@ -26,8 +26,8 @@ if (PLATFORM_ARM64)
elseif (PLATFORM_ARM32) elseif (PLATFORM_ARM32)
set(COMPONENT_NAME runtime-arm32-${PROCESS_UNIT}) set(COMPONENT_NAME runtime-arm32-${PROCESS_UNIT})
elseif (WIN32) elseif (WIN32)
set(PARSER_NAME libconverter-parser-win32-${PROCESS_UNIT}) set(PARSER_NAME libconverter-parser-win-${PROCESS_UNIT})
set(COMPONENT_NAME converter-win32-${PROCESS_UNIT}) set(COMPONENT_NAME converter-win-${PROCESS_UNIT})
else () else ()
set(COMPONENT_NAME convert-ubuntu) set(COMPONENT_NAME convert-ubuntu)
endif() endif()