cdevelop
2023-11-15 eff2570faf3dae7908db87edf4ef1a6ea88e5b33
解决windwos 加载lm模型失败 (#1093)

* fix vc compatibility

* fix windwos load lm model failed
5个文件已修改
32 ■■■■ 已修改文件
runtime/onnxruntime/CMakeLists.txt 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/onnxruntime/src/CMakeLists.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/onnxruntime/src/bias-lm.cpp 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/onnxruntime/third_party/openfst/src/lib/CMakeLists.txt 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/websocket/CMakeLists.txt 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/onnxruntime/CMakeLists.txt
@@ -55,7 +55,10 @@
    # with some patch to fix the make errors. 
    add_subdirectory(third_party/openfst)
    include_directories(${openfst_SOURCE_DIR}/src/include)
    if(WIN32)
    include_directories(${openfst_SOURCE_DIR}/src/lib)
    endif()
endif()
add_subdirectory(third_party/yaml-cpp)
runtime/onnxruntime/src/CMakeLists.txt
@@ -7,6 +7,7 @@
if(WIN32)
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/execution-charset:utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/source-charset:utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/bigobj>")
endif()
add_library(funasr SHARED ${files})
runtime/onnxruntime/src/bias-lm.cpp
@@ -1,5 +1,7 @@
#include "bias-lm.h"
#ifdef _WIN32
#include "fst-types.cc"
#endif
namespace funasr {
void print(std::queue<StateId> &q) {
  std::queue<StateId> data = q;
runtime/onnxruntime/third_party/openfst/src/lib/CMakeLists.txt
@@ -1,6 +1,20 @@
FILE(GLOB HEADER_FILES ../include/fst/*.h)
if(WIN32)
add_library(fst STATIC
  compat.cc
  flags.cc
  fst-types.cc
  fst.cc
  mapped-file.cc
  properties.cc
  symbol-table.cc
  symbol-table-ops.cc
  util.cc
  weight.cc
  ${HEADER_FILES}
)
else()
add_library(fst
  compat.cc
  flags.cc
@@ -14,6 +28,8 @@
  weight.cc
  ${HEADER_FILES}
)
endif()
set_target_properties(fst PROPERTIES
  SOVERSION "${SOVERSION}"
)
runtime/websocket/CMakeLists.txt
@@ -111,7 +111,9 @@
    # with some patch to fix the make errors. 
    add_subdirectory(${PROJECT_SOURCE_DIR}/../onnxruntime/third_party/openfst openfst)
    include_directories(${openfst_SOURCE_DIR}/src/include)
    if(WIN32)
    include_directories(${openfst_SOURCE_DIR}/src/lib)
    endif()
endif()