forked from mindspore-Ecosystem/mindspore
windows 32 compile
This commit is contained in:
parent
2d6f12d485
commit
a6aab8f4f4
|
@ -3,6 +3,7 @@ set(glog_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
|
|||
if(NOT ENABLE_GLIBCXX)
|
||||
set(glog_CXXFLAGS "${glog_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
|
||||
endif()
|
||||
|
||||
if(BUILD_LITE)
|
||||
set(glog_patch "")
|
||||
set(glog_lib glog)
|
||||
|
@ -10,6 +11,7 @@ else()
|
|||
set(glog_patch ${CMAKE_SOURCE_DIR}/third_party/patch/glog/glog.patch001)
|
||||
set(glog_lib mindspore_glog)
|
||||
endif()
|
||||
|
||||
if(ENABLE_GITEE)
|
||||
set(REQ_URL "https://gitee.com/mirrors/glog/repository/archive/v0.4.0.tar.gz")
|
||||
set(MD5 "22fe340ddc231e6c8e46bc295320f8ee")
|
||||
|
@ -18,12 +20,23 @@ else()
|
|||
set(MD5 "0daea8785e6df922d7887755c3d100d0")
|
||||
endif()
|
||||
|
||||
set(glog_option -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON -DWITH_GFLAGS=OFF)
|
||||
|
||||
if(WIN32)
|
||||
execute_process(COMMAND "${CMAKE_C_COMPILER}" -dumpmachine
|
||||
OUTPUT_VARIABLE i686_or_x86_64
|
||||
)
|
||||
if(i686_or_x86_64 MATCHES "^i686-")
|
||||
set(glog_option ${glog_option} -DHAVE_DBGHELP=ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mindspore_add_pkg(glog
|
||||
VER 0.4.0
|
||||
LIBS ${glog_lib}
|
||||
URL ${REQ_URL}
|
||||
MD5 ${MD5}
|
||||
PATCHES ${glog_patch}
|
||||
CMAKE_OPTION -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON -DWITH_GFLAGS=OFF)
|
||||
CMAKE_OPTION ${glog_option})
|
||||
include_directories(${glog_INC})
|
||||
add_library(mindspore::glog ALIAS glog::${glog_lib})
|
||||
|
|
|
@ -204,7 +204,7 @@ elseif(PLATFORM_ARM32)
|
|||
elseif(WIN32)
|
||||
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)
|
||||
${CXX_DIR}/libssp-0.dll ${CXX_DIR}/libgcc_s_*-1.dll)
|
||||
if(ENABLE_CONVERTER)
|
||||
install(TARGETS converter_lite RUNTIME DESTINATION ${CONVERTER_ROOT_DIR}/converter
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
|
|
|
@ -84,25 +84,26 @@ add_compile_options(-fPIC)
|
|||
|
||||
if(SUPPORT_TRAIN)
|
||||
set(BUILD_MINDDATA "full")
|
||||
if(PLATFORM_ARM64)
|
||||
set(RUNTIME_COMPONENT_NAME train-android-aarch64)
|
||||
elseif(PLATFORM_ARM32)
|
||||
set(RUNTIME_COMPONENT_NAME train-android-aarch32)
|
||||
elseif(WIN32)
|
||||
set(RUNTIME_COMPONENT_NAME train-win-x64)
|
||||
set(TRAIN_OR_INFERENCE "train")
|
||||
else()
|
||||
set(TRAIN_OR_INFERENCE "inference")
|
||||
endif()
|
||||
|
||||
if(PLATFORM_ARM64)
|
||||
set(RUNTIME_COMPONENT_NAME ${TRAIN_OR_INFERENCE}-android-aarch64)
|
||||
elseif(PLATFORM_ARM32)
|
||||
set(RUNTIME_COMPONENT_NAME ${TRAIN_OR_INFERENCE}-android-aarch32)
|
||||
elseif(WIN32)
|
||||
execute_process(COMMAND "${CMAKE_C_COMPILER}" -dumpmachine
|
||||
OUTPUT_VARIABLE i686_or_x86_64
|
||||
)
|
||||
if(i686_or_x86_64 MATCHES "^i686-")
|
||||
set(RUNTIME_COMPONENT_NAME ${TRAIN_OR_INFERENCE}-win-x86)
|
||||
else()
|
||||
set(RUNTIME_COMPONENT_NAME train-linux-x64)
|
||||
set(RUNTIME_COMPONENT_NAME ${TRAIN_OR_INFERENCE}-win-x64)
|
||||
endif()
|
||||
else()
|
||||
if(PLATFORM_ARM64)
|
||||
set(RUNTIME_COMPONENT_NAME inference-android-aarch64)
|
||||
elseif(PLATFORM_ARM32)
|
||||
set(RUNTIME_COMPONENT_NAME inference-android-aarch32)
|
||||
elseif(WIN32)
|
||||
set(RUNTIME_COMPONENT_NAME inference-win-x64)
|
||||
else()
|
||||
set(RUNTIME_COMPONENT_NAME inference-linux-x64)
|
||||
endif()
|
||||
set(RUNTIME_COMPONENT_NAME ${TRAIN_OR_INFERENCE}-linux-x64)
|
||||
endif()
|
||||
|
||||
string(REPLACE "/mindspore/lite" "" TOP_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
|
Loading…
Reference in New Issue