Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Windows packaging issue #22102

Merged
merged 1 commit into from Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packaging/tools/make_install.bat
Expand Up @@ -56,8 +56,8 @@ copy %binary_dir%\\build\\bin\\taos.exe %target_dir% > nul
if exist %binary_dir%\\build\\bin\\taosBenchmark.exe (
copy %binary_dir%\\build\\bin\\taosBenchmark.exe %target_dir% > nul
)
if exist %binary_dir%\\build\\lib\\taosws.dll.lib (
copy %binary_dir%\\build\\lib\\taosws.dll.lib %target_dir%\\driver > nul
if exist %binary_dir%\\build\\lib\\taosws.lib (
copy %binary_dir%\\build\\lib\\taosws.lib %target_dir%\\driver > nul
)
if exist %binary_dir%\\build\\lib\\taosws.dll (
copy %binary_dir%\\build\\lib\\taosws.dll %target_dir%\\driver > nul
Expand Down
22 changes: 20 additions & 2 deletions tools/CMakeLists.txt
Expand Up @@ -3,8 +3,6 @@ IF (TD_WEBSOCKET)
SET(websocket_lib_file "libtaosws.so")
ELSEIF (TD_DARWIN)
SET(websocket_lib_file "libtaosws.dylib")
ELSEIF (TD_WINDOWS)
SET(websocket_lib_file "{taosws.dll,taosws.dll.lib}")
ENDIF ()
MESSAGE("${Green} use libtaos-ws${ColourReset}")
IF (TD_ALPINE)
Expand All @@ -26,6 +24,26 @@ IF (TD_WEBSOCKET)
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include
COMMAND cmake -E copy target/release/taosws.h ${CMAKE_BINARY_DIR}/build/include
)
ELSEIF (TD_WINDOWS)
include(ExternalProject)
ExternalProject_Add(taosws-rs
PREFIX "taosws-rs"
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs
BUILD_ALWAYS off
DEPENDS taos
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo "taosws-rs no need cmake to config"
PATCH_COMMAND
COMMAND git clean -f -d
BUILD_COMMAND
COMMAND cargo update
COMMAND cargo build --release -p taos-ws-sys --features native-tls-vendored
INSTALL_COMMAND
COMMAND cp target/release/taosws.dll ${CMAKE_BINARY_DIR}/build/lib
COMMAND cp target/release/taosws.dll.lib ${CMAKE_BINARY_DIR}/build/lib/taosws.lib
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include
COMMAND cmake -E copy target/release/taosws.h ${CMAKE_BINARY_DIR}/build/include
)
ELSE()
include(ExternalProject)
ExternalProject_Add(taosws-rs
Expand Down
2 changes: 1 addition & 1 deletion tools/shell/CMakeLists.txt
Expand Up @@ -20,7 +20,7 @@ ELSEIF (TD_DARWIN AND TD_WEBSOCKET)
ADD_DEPENDENCIES(shell taosws-rs)
ELSEIF (TD_WINDOWS AND TD_WEBSOCKET)
ADD_DEFINITIONS(-DWEBSOCKET -I${CMAKE_BINARY_DIR}/build/include)
SET(LINK_WEBSOCKET "${CMAKE_BINARY_DIR}/build/lib/taosws.dll.lib")
SET(LINK_WEBSOCKET "${CMAKE_BINARY_DIR}/build/lib/taosws.lib")
ADD_DEPENDENCIES(shell taosws-rs)
ELSE ()
SET(LINK_WEBSOCKET "")
Expand Down