From 28ccfbfc51068a663a80764e14074df5edf2b5ba Mon Sep 17 00:00:00 2001
From: kongdeqiang <kongdeqiang960204@163.com>
Date: 星期五, 13 三月 2026 17:41:41 +0800
Subject: [PATCH] 提交
---
runtime/websocket/CMakeLists.txt | 32 +++++++++++++++++++++++---------
1 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/runtime/websocket/CMakeLists.txt b/runtime/websocket/CMakeLists.txt
index a34798e..da0e6e7 100644
--- a/runtime/websocket/CMakeLists.txt
+++ b/runtime/websocket/CMakeLists.txt
@@ -8,24 +8,38 @@
option(ENABLE_WEBSOCKET "Whether to build websocket server" ON)
option(ENABLE_PORTAUDIO "Whether to build portaudio" ON)
+option(ENABLE_GLOG "Whether to build glog" ON)
+option(ENABLE_FST "Whether to build openfst" ON) # ITN need openfst compiled
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+option(GPU "Whether to build with GPU" OFF)
if(WIN32)
+ file(REMOVE ${PROJECT_SOURCE_DIR}/../onnxruntime/third_party/glog/src/config.h
+ ${PROJECT_SOURCE_DIR}/../onnxruntime/third_party/glog/src/glog/export.h
+ ${PROJECT_SOURCE_DIR}/../onnxruntime/third_party/glog/src/glog/logging.h
+ ${PROJECT_SOURCE_DIR}/../onnxruntime/third_party/glog/src/glog/raw_logging.h
+ ${PROJECT_SOURCE_DIR}/../onnxruntime/third_party/glog/src/glog/stl_logging.h
+ ${PROJECT_SOURCE_DIR}/../onnxruntime/third_party/glog/src/glog/vlog_is_on.h)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -fPIC")
endif()
-
-
-
-option(ENABLE_GLOG "Whether to build glog" ON)
-option(ENABLE_FST "Whether to build openfst" ON) # ITN need openfst compiled
-option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+if(GPU)
+ add_definitions(-DUSE_GPU)
+ set(TORCH_DIR "/usr/local/lib/python3.8/dist-packages/torch")
+ set(TORCH_BLADE_DIR "/usr/local/lib/python3.8/dist-packages/torch_blade")
+ include_directories(${TORCH_DIR}/include)
+ include_directories(${TORCH_DIR}/include/torch/csrc/api/include)
+ link_directories(${TORCH_DIR}/lib)
+ link_directories(${TORCH_BLADE_DIR})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0")
+endif()
if(ENABLE_WEBSOCKET)
# cmake_policy(SET CMP0135 NEW)
include(FetchContent)
- if(NOT EXISTS ${PROJECT_SOURCE_DIR}/third_party/websocket )
+ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/third_party/websocket/websocketpp )
FetchContent_Declare(websocketpp
GIT_REPOSITORY https://github.com/zaphoyd/websocketpp.git
GIT_TAG 0.8.2
@@ -36,7 +50,7 @@
endif()
include_directories(${PROJECT_SOURCE_DIR}/third_party/websocket)
- if(NOT EXISTS ${PROJECT_SOURCE_DIR}/third_party/asio )
+ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/third_party/asio/asio )
FetchContent_Declare(asio
URL https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-1-24-0.tar.gz
SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/asio
@@ -46,7 +60,7 @@
endif()
include_directories(${PROJECT_SOURCE_DIR}/third_party/asio/asio/include)
- if(NOT EXISTS ${PROJECT_SOURCE_DIR}/third_party/json )
+ 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
--
Gitblit v1.9.1