mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
解决windwos 加载lm模型失败 (#1093)
* fix vc compatibility * fix windwos load lm model failed
This commit is contained in:
parent
12d694f94c
commit
eff2570faf
@ -55,7 +55,10 @@ if(ENABLE_FST)
|
|||||||
# with some patch to fix the make errors.
|
# with some patch to fix the make errors.
|
||||||
add_subdirectory(third_party/openfst)
|
add_subdirectory(third_party/openfst)
|
||||||
include_directories(${openfst_SOURCE_DIR}/src/include)
|
include_directories(${openfst_SOURCE_DIR}/src/include)
|
||||||
|
if(WIN32)
|
||||||
|
include_directories(${openfst_SOURCE_DIR}/src/lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(third_party/yaml-cpp)
|
add_subdirectory(third_party/yaml-cpp)
|
||||||
|
|||||||
@ -7,6 +7,7 @@ message("files: "${files})
|
|||||||
if(WIN32)
|
if(WIN32)
|
||||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/execution-charset:utf-8>")
|
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>:/source-charset:utf-8>")
|
||||||
|
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/bigobj>")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(funasr SHARED ${files})
|
add_library(funasr SHARED ${files})
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
#include "bias-lm.h"
|
#include "bias-lm.h"
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include "fst-types.cc"
|
||||||
|
#endif
|
||||||
namespace funasr {
|
namespace funasr {
|
||||||
void print(std::queue<StateId> &q) {
|
void print(std::queue<StateId> &q) {
|
||||||
std::queue<StateId> data = q;
|
std::queue<StateId> data = q;
|
||||||
|
|||||||
@ -1,6 +1,20 @@
|
|||||||
FILE(GLOB HEADER_FILES ../include/fst/*.h)
|
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
|
add_library(fst
|
||||||
compat.cc
|
compat.cc
|
||||||
flags.cc
|
flags.cc
|
||||||
@ -14,6 +28,8 @@ add_library(fst
|
|||||||
weight.cc
|
weight.cc
|
||||||
${HEADER_FILES}
|
${HEADER_FILES}
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set_target_properties(fst PROPERTIES
|
set_target_properties(fst PROPERTIES
|
||||||
SOVERSION "${SOVERSION}"
|
SOVERSION "${SOVERSION}"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -111,7 +111,9 @@ if(ENABLE_FST)
|
|||||||
# with some patch to fix the make errors.
|
# with some patch to fix the make errors.
|
||||||
add_subdirectory(${PROJECT_SOURCE_DIR}/../onnxruntime/third_party/openfst openfst)
|
add_subdirectory(${PROJECT_SOURCE_DIR}/../onnxruntime/third_party/openfst openfst)
|
||||||
include_directories(${openfst_SOURCE_DIR}/src/include)
|
include_directories(${openfst_SOURCE_DIR}/src/include)
|
||||||
|
if(WIN32)
|
||||||
|
include_directories(${openfst_SOURCE_DIR}/src/lib)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user