From d80ac2fd2df4e7fb8a28acfa512bb11472b5cc99 Mon Sep 17 00:00:00 2001
From: liugz18 <57401541+liugz18@users.noreply.github.com>
Date: 星期四, 18 七月 2024 21:34:55 +0800
Subject: [PATCH] Rename 'res' in line 514 to avoid with naming conflict with line 365
---
runtime/websocket/bin/CMakeLists.txt | 31 +++++++++++++++++++++++--------
1 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/runtime/websocket/bin/CMakeLists.txt b/runtime/websocket/bin/CMakeLists.txt
index b46e2ca..8df8ce0 100644
--- a/runtime/websocket/bin/CMakeLists.txt
+++ b/runtime/websocket/bin/CMakeLists.txt
@@ -1,10 +1,25 @@
-add_executable(funasr-wss-server "funasr-wss-server.cpp" "websocket-server.cpp")
-add_executable(funasr-wss-server-2pass "funasr-wss-server-2pass.cpp" "websocket-server-2pass.cpp")
-add_executable(funasr-wss-client "funasr-wss-client.cpp")
-add_executable(funasr-wss-client-2pass "funasr-wss-client-2pass.cpp" "microphone.cpp")
+if(WIN32)
+ include_directories(${ONNXRUNTIME_DIR}/include)
+ include_directories(${FFMPEG_DIR}/include)
+ include_directories(${OPENSSL_ROOT_DIR}//include)
+ link_directories(${OPENSSL_ROOT_DIR}/lib)
+ add_definitions(-D_WEBSOCKETPP_CPP11_RANDOM_DEVICE_)
+ add_definitions(-D_WEBSOCKETPP_CPP11_TYPE_TRAITS_)
+ add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/bigobj>")
+ add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
+ SET(RELATION_SOURCE "../../onnxruntime/src/resample.cpp" "../../onnxruntime/src/util.cpp" "../../onnxruntime/src/alignedmem.cpp" "../../onnxruntime/src/encode_converter.cpp")
+endif()
-target_link_libraries(funasr-wss-client PUBLIC funasr ssl crypto)
-target_link_libraries(funasr-wss-client-2pass PUBLIC funasr ssl crypto portaudio)
-target_link_libraries(funasr-wss-server PUBLIC funasr ssl crypto)
-target_link_libraries(funasr-wss-server-2pass PUBLIC funasr ssl crypto)
+add_executable(funasr-wss-server "funasr-wss-server.cpp" "websocket-server.cpp" ${RELATION_SOURCE})
+add_executable(funasr-wss-server-2pass "funasr-wss-server-2pass.cpp" "websocket-server-2pass.cpp" ${RELATION_SOURCE})
+add_executable(funasr-wss-client "funasr-wss-client.cpp" ${RELATION_SOURCE})
+add_executable(funasr-wss-client-2pass "funasr-wss-client-2pass.cpp" "microphone.cpp" ${RELATION_SOURCE})
+
+target_link_options(funasr-wss-server PRIVATE "-Wl,--no-as-needed")
+target_link_options(funasr-wss-server-2pass PRIVATE "-Wl,--no-as-needed")
+
+target_link_libraries(funasr-wss-client PUBLIC funasr ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_SSL_LIBRARY})
+target_link_libraries(funasr-wss-client-2pass PUBLIC funasr ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_SSL_LIBRARY} portaudio)
+target_link_libraries(funasr-wss-server PUBLIC funasr ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_SSL_LIBRARY})
+target_link_libraries(funasr-wss-server-2pass PUBLIC funasr ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_SSL_LIBRARY})
--
Gitblit v1.9.1