Support building debug version on Windows (#583)

This commit is contained in:
Fangjun Kuang
2024-02-18 10:39:55 +08:00
committed by GitHub
parent 81da0fb7a6
commit 64007a6193
9 changed files with 323 additions and 4 deletions

View File

@@ -69,7 +69,13 @@ function(download_onnxruntime)
if(BUILD_SHARED_LIBS)
include(onnxruntime-win-x86)
else()
include(onnxruntime-win-x86-static)
if(CMAKE_BUILD_TYPE STREQUAL Release)
include(onnxruntime-win-x86-static)
elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
include(onnxruntime-win-x86-static-debug)
else()
message(STATUS "Support only CMAKE_BUILD_TYPE Release or Debug. Given: ${CMAKE_BUILD_TYPE}")
endif()
endif()
if(SHERPA_ONNX_ENABLE_GPU)
@@ -87,7 +93,13 @@ function(download_onnxruntime)
else()
# static libraries for windows x64
message(STATUS "Use static onnxruntime libraries")
include(onnxruntime-win-x64-static)
if(CMAKE_BUILD_TYPE STREQUAL Release)
include(onnxruntime-win-x64-static)
elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
include(onnxruntime-win-x64-static-debug)
else()
message(STATUS "Support only CMAKE_BUILD_TYPE Release or Debug. Given: ${CMAKE_BUILD_TYPE}")
endif()
endif()
endif()
else()