fix dml with preinstall ort (#2066)

This commit is contained in:
Anders Xiao
2025-03-30 12:07:19 +08:00
committed by GitHub
parent 3420c89883
commit ce196fceae
4 changed files with 95 additions and 72 deletions

View File

@@ -37,6 +37,8 @@ option(SHERPA_ONNX_ENABLE_C_API "Whether to build C API" ON)
option(SHERPA_ONNX_ENABLE_WEBSOCKET "Whether to build webscoket server/client" ON)
option(SHERPA_ONNX_ENABLE_GPU "Enable ONNX Runtime GPU support" OFF)
option(SHERPA_ONNX_ENABLE_DIRECTML "Enable ONNX Runtime DirectML support" OFF)
option(SHERPA_ONNX_LINK_D3D "Whether static ONNX runtime lib with DML" OFF)
option(SHERPA_ONNX_ENABLE_WASM "Whether to enable WASM" OFF)
option(SHERPA_ONNX_ENABLE_WASM_SPEAKER_DIARIZATION "Whether to enable WASM for speaker diarization" OFF)
option(SHERPA_ONNX_ENABLE_WASM_TTS "Whether to enable WASM for TTS" OFF)
@@ -165,6 +167,7 @@ message(STATUS "SHERPA_ONNX_USE_PRE_INSTALLED_ONNXRUNTIME_IF_AVAILABLE ${SHERPA_
message(STATUS "SHERPA_ONNX_ENABLE_SANITIZER: ${SHERPA_ONNX_ENABLE_SANITIZER}")
message(STATUS "SHERPA_ONNX_BUILD_C_API_EXAMPLES: ${SHERPA_ONNX_BUILD_C_API_EXAMPLES}")
message(STATUS "SHERPA_ONNX_ENABLE_RKNN: ${SHERPA_ONNX_ENABLE_RKNN}")
message(STATUS "SHERPA_ONNX_LINK_D3D: ${SHERPA_ONNX_LINK_D3D}")
if(BUILD_SHARED_LIBS OR SHERPA_ONNX_ENABLE_JNI)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
@@ -311,6 +314,7 @@ if(WIN32)
add_definitions(-DNOMINMAX) # Otherwise, std::max() and std::min() won't work
endif()
if(WIN32 AND MSVC)
# disable various warnings for MSVC
# 4244: 'return': conversion from 'unsigned __int64' to 'int', possible loss of data