From b85e140c3e4a7a7ccba59abfc67b63aac7a28dd9 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 17 五月 2024 17:28:56 +0800
Subject: [PATCH] update

---
 runtime/onnxruntime/CMakeLists.txt |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/runtime/onnxruntime/CMakeLists.txt b/runtime/onnxruntime/CMakeLists.txt
index 2f193b0..d8e623e 100644
--- a/runtime/onnxruntime/CMakeLists.txt
+++ b/runtime/onnxruntime/CMakeLists.txt
@@ -18,13 +18,25 @@
     message("Little endian system")
 endif()
 
+# json
+include(FetchContent)
+if(NOT EXISTS ${PROJECT_SOURCE_DIR}/third_party/json/ChangeLog.md )
+FetchContent_Declare(json
+  URL   https://github.com/nlohmann/json/archive/refs/tags/v3.11.2.tar.gz
+SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/json
+)
+
+FetchContent_MakeAvailable(json)
+endif()
+
 # for onnxruntime
 IF(WIN32)
-	if(CMAKE_CL_64)
-		link_directories(${ONNXRUNTIME_DIR}\\lib)
-	else()
-		add_definitions(-D_WIN_X86)
-	endif()
+    file(REMOVE ${PROJECT_SOURCE_DIR}/third_party/glog/src/config.h 
+                ${PROJECT_SOURCE_DIR}/third_party/glog/src/glog/export.h 
+                ${PROJECT_SOURCE_DIR}/third_party/glog/src/glog/logging.h 
+                ${PROJECT_SOURCE_DIR}/third_party/glog/src/glog/raw_logging.h 
+                ${PROJECT_SOURCE_DIR}/third_party/glog/src/glog/stl_logging.h 
+                ${PROJECT_SOURCE_DIR}/third_party/glog/src/glog/vlog_is_on.h)
 ELSE()
     link_directories(${ONNXRUNTIME_DIR}/lib)
     link_directories(${FFMPEG_DIR}/lib)
@@ -35,6 +47,7 @@
 include_directories(${PROJECT_SOURCE_DIR}/third_party/jieba/include)
 include_directories(${PROJECT_SOURCE_DIR}/third_party/jieba/include/limonp/include)
 include_directories(${PROJECT_SOURCE_DIR}/third_party/kaldi)
+include_directories(${PROJECT_SOURCE_DIR}/third_party/json/include)
 
 if(ENABLE_GLOG)
     include_directories(${PROJECT_SOURCE_DIR}/third_party/glog/src)
@@ -54,7 +67,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)

--
Gitblit v1.9.1